{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "乐学偶得版权所有  公众号：乐学Fintech  主讲人：William 网站：lexueoude.com  <br> LX_LAB教研团队提供技术支持 正版视频： 网易云课堂：乐学偶得"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "随机振荡器(不要被这个中文吓到，其实就是一种动量指标)\n",
    "ramdon walk"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "比如说：我们想看一个月(30天)的通道\n",
    "\n",
    "%K $= 100* \\frac{Price-L_{30}}{H_{30}-L_{30}} $ <br>\n",
    "%D $=\\frac{K_1+K_2+K_3}{3}$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "推广到一般情况：\n",
    "RSV(Raw Stochastic Value)未成熟随机值\n",
    "\n",
    "$RSV = \\frac{C_n-L_n}{H_n-L_n}*100$\n",
    "可以通过调整n来自定义指标\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "KDJ,相当于就是%K,和%D的基础上，再加上一条线%J：\n",
    "\n",
    "1）谁是快线？谁是慢线？\n",
    "%K为快线，%D为慢线\n",
    "\n",
    "2）那么什么是第三根%J线？\n",
    "\n",
    "$K_t = \\frac{2}{3}*K_{t-1}+\\frac{1}{3}*RSV_t$ <br>\n",
    "$D_t = \\frac{2}{3}*D_{t-1}+\\frac{1}{3}*K_t$ <br>\n",
    "$J_t = 3* K_{t}-2*D_{t} $\n",
    "\n",
    "\n",
    "\n",
    "若无前一日数据，用50代替\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>20200522</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.40</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.5821</td>\n",
       "      <td>856237.33</td>\n",
       "      <td>1119433.491</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>20200521</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.57</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.40</td>\n",
       "      <td>13.51</td>\n",
       "      <td>-0.11</td>\n",
       "      <td>-0.8142</td>\n",
       "      <td>552312.00</td>\n",
       "      <td>742797.057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>20200520</td>\n",
       "      <td>13.38</td>\n",
       "      <td>13.62</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.51</td>\n",
       "      <td>13.36</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.1228</td>\n",
       "      <td>690851.07</td>\n",
       "      <td>929928.885</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>20200519</td>\n",
       "      <td>13.41</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.20</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.2121</td>\n",
       "      <td>600368.64</td>\n",
       "      <td>801755.671</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>20200518</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.34</td>\n",
       "      <td>13.12</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.23</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2268</td>\n",
       "      <td>637208.57</td>\n",
       "      <td>843479.669</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     ts_code trade_date   open   high    low  close  pre_close  change  \\\n",
       "0  000001.SZ   20200522  13.33  13.34  12.92  12.92      13.40   -0.48   \n",
       "1  000001.SZ   20200521  13.52  13.57  13.36  13.40      13.51   -0.11   \n",
       "2  000001.SZ   20200520  13.38  13.62  13.27  13.51      13.36    0.15   \n",
       "3  000001.SZ   20200519  13.41  13.45  13.27  13.36      13.20    0.16   \n",
       "4  000001.SZ   20200518  13.20  13.34  13.12  13.20      13.23   -0.03   \n",
       "\n",
       "   pct_chg        vol       amount  \n",
       "0  -3.5821  856237.33  1119433.491  \n",
       "1  -0.8142  552312.00   742797.057  \n",
       "2   1.1228  690851.07   929928.885  \n",
       "3   1.2121  600368.64   801755.671  \n",
       "4  -0.2268  637208.57   843479.669  "
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import tushare as ts\n",
    "import pandas as pd\n",
    "ts.set_token('09e4ce601d278a47514902d805936146d469550c6ec9c3b42d1d2343')\n",
    "pro = ts.pro_api()\n",
    "df_whole = pro.daily(ts_code='000001.SZ', start_date='20190101', end_date='2020401')\n",
    "df_whole.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole[\"trade_date\"]=pd.to_datetime(df_whole[\"trade_date\"],format=\"%Y%m%d\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0   2020-05-22\n",
       "1   2020-05-21\n",
       "2   2020-05-20\n",
       "3   2020-05-19\n",
       "4   2020-05-18\n",
       "Name: trade_date, dtype: datetime64[ns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole[\"trade_date\"].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole.set_index(\"trade_date\",inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2020-05-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.40</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.5821</td>\n",
       "      <td>856237.33</td>\n",
       "      <td>1119433.491</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.57</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.40</td>\n",
       "      <td>13.51</td>\n",
       "      <td>-0.11</td>\n",
       "      <td>-0.8142</td>\n",
       "      <td>552312.00</td>\n",
       "      <td>742797.057</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.38</td>\n",
       "      <td>13.62</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.51</td>\n",
       "      <td>13.36</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.1228</td>\n",
       "      <td>690851.07</td>\n",
       "      <td>929928.885</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.41</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.20</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.2121</td>\n",
       "      <td>600368.64</td>\n",
       "      <td>801755.671</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.34</td>\n",
       "      <td>13.12</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.23</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2268</td>\n",
       "      <td>637208.57</td>\n",
       "      <td>843479.669</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2020-05-22  000001.SZ  13.33  13.34  12.92  12.92      13.40   -0.48  -3.5821   \n",
       "2020-05-21  000001.SZ  13.52  13.57  13.36  13.40      13.51   -0.11  -0.8142   \n",
       "2020-05-20  000001.SZ  13.38  13.62  13.27  13.51      13.36    0.15   1.1228   \n",
       "2020-05-19  000001.SZ  13.41  13.45  13.27  13.36      13.20    0.16   1.2121   \n",
       "2020-05-18  000001.SZ  13.20  13.34  13.12  13.20      13.23   -0.03  -0.2268   \n",
       "\n",
       "                  vol       amount  \n",
       "trade_date                          \n",
       "2020-05-22  856237.33  1119433.491  \n",
       "2020-05-21  552312.00   742797.057  \n",
       "2020-05-20  690851.07   929928.885  \n",
       "2020-05-19  600368.64   801755.671  \n",
       "2020-05-18  637208.57   843479.669  "
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole=df_whole.sort_index(ascending=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-02</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.39</td>\n",
       "      <td>9.42</td>\n",
       "      <td>9.16</td>\n",
       "      <td>9.19</td>\n",
       "      <td>9.38</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-2.0256</td>\n",
       "      <td>539386.32</td>\n",
       "      <td>498695.109</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-03</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.18</td>\n",
       "      <td>9.33</td>\n",
       "      <td>9.15</td>\n",
       "      <td>9.28</td>\n",
       "      <td>9.19</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.9793</td>\n",
       "      <td>415537.95</td>\n",
       "      <td>384457.707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-04</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.24</td>\n",
       "      <td>9.82</td>\n",
       "      <td>9.22</td>\n",
       "      <td>9.75</td>\n",
       "      <td>9.28</td>\n",
       "      <td>0.47</td>\n",
       "      <td>5.0647</td>\n",
       "      <td>1481159.06</td>\n",
       "      <td>1422149.888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.84</td>\n",
       "      <td>9.85</td>\n",
       "      <td>9.63</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.75</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.1026</td>\n",
       "      <td>865687.66</td>\n",
       "      <td>841166.430</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.73</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.62</td>\n",
       "      <td>9.66</td>\n",
       "      <td>9.74</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.8214</td>\n",
       "      <td>402388.11</td>\n",
       "      <td>389247.795</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code  open  high   low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                   \n",
       "2019-01-02  000001.SZ  9.39  9.42  9.16   9.19       9.38   -0.19  -2.0256   \n",
       "2019-01-03  000001.SZ  9.18  9.33  9.15   9.28       9.19    0.09   0.9793   \n",
       "2019-01-04  000001.SZ  9.24  9.82  9.22   9.75       9.28    0.47   5.0647   \n",
       "2019-01-07  000001.SZ  9.84  9.85  9.63   9.74       9.75   -0.01  -0.1026   \n",
       "2019-01-08  000001.SZ  9.73  9.74  9.62   9.66       9.74   -0.08  -0.8214   \n",
       "\n",
       "                   vol       amount  \n",
       "trade_date                           \n",
       "2019-01-02   539386.32   498695.109  \n",
       "2019-01-03   415537.95   384457.707  \n",
       "2019-01-04  1481159.06  1422149.888  \n",
       "2019-01-07   865687.66   841166.430  \n",
       "2019-01-08   402388.11   389247.795  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "low_price_list = df_whole['low'].rolling(window=9).min()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "2019-01-02   NaN\n",
       "2019-01-03   NaN\n",
       "2019-01-04   NaN\n",
       "2019-01-07   NaN\n",
       "2019-01-08   NaN\n",
       "Name: low, dtype: float64"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "low_price_list.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "high_price_list = df_whole['high'].rolling(window=9).max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "2019-01-02   NaN\n",
       "2019-01-03   NaN\n",
       "2019-01-04   NaN\n",
       "2019-01-07   NaN\n",
       "2019-01-08   NaN\n",
       "Name: high, dtype: float64"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "high_price_list.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "2019-01-02    9.19\n",
       "2019-01-03    9.28\n",
       "2019-01-04    9.75\n",
       "2019-01-07    9.74\n",
       "2019-01-08    9.66\n",
       "Name: close, dtype: float64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole['close'].head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "RSV = (df_whole['close']-low_price_list)/(high_price_list-low_price_list)*100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(RSV)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "2019-01-02          NaN\n",
       "2019-01-03          NaN\n",
       "2019-01-04          NaN\n",
       "2019-01-07          NaN\n",
       "2019-01-08          NaN\n",
       "2019-01-09          NaN\n",
       "2019-01-10          NaN\n",
       "2019-01-11          NaN\n",
       "2019-01-14    87.272727\n",
       "2019-01-15    96.460177\n",
       "2019-01-16    98.437500\n",
       "2019-01-17    66.315789\n",
       "2019-01-18    85.263158\n",
       "2019-01-21    73.563218\n",
       "2019-01-22    59.154930\n",
       "2019-01-23    57.692308\n",
       "2019-01-24    90.000000\n",
       "2019-01-25    95.789474\n",
       "2019-01-28    79.381443\n",
       "2019-01-29    85.567010\n",
       "2019-01-30    75.000000\n",
       "2019-01-31    89.361702\n",
       "2019-02-01    94.949495\n",
       "2019-02-11    95.833333\n",
       "2019-02-12    87.234043\n",
       "2019-02-13    96.511628\n",
       "2019-02-14    75.000000\n",
       "2019-02-15    28.125000\n",
       "2019-02-18    90.909091\n",
       "2019-02-19    51.388889\n",
       "                ...    \n",
       "2020-04-08    27.710843\n",
       "2020-04-09    22.891566\n",
       "2020-04-10    41.379310\n",
       "2020-04-13    18.181818\n",
       "2020-04-14    59.090909\n",
       "2020-04-15    78.431373\n",
       "2020-04-16    41.176471\n",
       "2020-04-17    73.684211\n",
       "2020-04-20    89.655172\n",
       "2020-04-21    79.674797\n",
       "2020-04-22    61.788618\n",
       "2020-04-23    61.788618\n",
       "2020-04-24    60.344828\n",
       "2020-04-27    82.758621\n",
       "2020-04-28    84.482759\n",
       "2020-04-29    94.482759\n",
       "2020-04-30    74.838710\n",
       "2020-05-06    54.545455\n",
       "2020-05-07    47.933884\n",
       "2020-05-08    69.421488\n",
       "2020-05-11    73.553719\n",
       "2020-05-12    50.467290\n",
       "2020-05-13    34.285714\n",
       "2020-05-14     7.272727\n",
       "2020-05-15     7.627119\n",
       "2020-05-18     7.920792\n",
       "2020-05-19    23.762376\n",
       "2020-05-20    38.613861\n",
       "2020-05-21    27.722772\n",
       "2020-05-22     0.000000\n",
       "Length: 336, dtype: float64"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "RSV"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole['RSV'] = RSV"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>RSV</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-02</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.39</td>\n",
       "      <td>9.42</td>\n",
       "      <td>9.16</td>\n",
       "      <td>9.19</td>\n",
       "      <td>9.38</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-2.0256</td>\n",
       "      <td>539386.32</td>\n",
       "      <td>498695.109</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-03</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.18</td>\n",
       "      <td>9.33</td>\n",
       "      <td>9.15</td>\n",
       "      <td>9.28</td>\n",
       "      <td>9.19</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.9793</td>\n",
       "      <td>415537.95</td>\n",
       "      <td>384457.707</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-04</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.24</td>\n",
       "      <td>9.82</td>\n",
       "      <td>9.22</td>\n",
       "      <td>9.75</td>\n",
       "      <td>9.28</td>\n",
       "      <td>0.47</td>\n",
       "      <td>5.0647</td>\n",
       "      <td>1481159.06</td>\n",
       "      <td>1422149.888</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.84</td>\n",
       "      <td>9.85</td>\n",
       "      <td>9.63</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.75</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.1026</td>\n",
       "      <td>865687.66</td>\n",
       "      <td>841166.430</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.73</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.62</td>\n",
       "      <td>9.66</td>\n",
       "      <td>9.74</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.8214</td>\n",
       "      <td>402388.11</td>\n",
       "      <td>389247.795</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-09</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.74</td>\n",
       "      <td>10.08</td>\n",
       "      <td>9.70</td>\n",
       "      <td>9.94</td>\n",
       "      <td>9.66</td>\n",
       "      <td>0.28</td>\n",
       "      <td>2.8986</td>\n",
       "      <td>1233486.36</td>\n",
       "      <td>1229465.116</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-10</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.87</td>\n",
       "      <td>10.20</td>\n",
       "      <td>9.86</td>\n",
       "      <td>10.10</td>\n",
       "      <td>9.94</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.6097</td>\n",
       "      <td>1071817.66</td>\n",
       "      <td>1079711.035</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.20</td>\n",
       "      <td>10.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.9901</td>\n",
       "      <td>696364.55</td>\n",
       "      <td>708001.802</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.07</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.20</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8824</td>\n",
       "      <td>500443.59</td>\n",
       "      <td>507862.882</td>\n",
       "      <td>87.272727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.11</td>\n",
       "      <td>0.13</td>\n",
       "      <td>1.2859</td>\n",
       "      <td>542160.55</td>\n",
       "      <td>553027.309</td>\n",
       "      <td>96.460177</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.23</td>\n",
       "      <td>10.48</td>\n",
       "      <td>10.24</td>\n",
       "      <td>0.24</td>\n",
       "      <td>2.3438</td>\n",
       "      <td>977699.37</td>\n",
       "      <td>1017495.116</td>\n",
       "      <td>98.437500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.57</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.48</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.1947</td>\n",
       "      <td>882811.92</td>\n",
       "      <td>910212.066</td>\n",
       "      <td>66.315789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.49</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.43</td>\n",
       "      <td>10.25</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.7561</td>\n",
       "      <td>738793.26</td>\n",
       "      <td>769973.637</td>\n",
       "      <td>85.263158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.32</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.43</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8629</td>\n",
       "      <td>659355.76</td>\n",
       "      <td>684465.646</td>\n",
       "      <td>73.563218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.44</td>\n",
       "      <td>10.26</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.34</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5803</td>\n",
       "      <td>424413.57</td>\n",
       "      <td>438991.450</td>\n",
       "      <td>59.154930</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.35</td>\n",
       "      <td>10.28</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.6809</td>\n",
       "      <td>537876.63</td>\n",
       "      <td>559384.396</td>\n",
       "      <td>57.692308</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.40</td>\n",
       "      <td>10.55</td>\n",
       "      <td>10.37</td>\n",
       "      <td>10.52</td>\n",
       "      <td>10.35</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.6425</td>\n",
       "      <td>679240.88</td>\n",
       "      <td>711495.718</td>\n",
       "      <td>90.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.56</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.55</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>4.5627</td>\n",
       "      <td>2108361.85</td>\n",
       "      <td>2299718.224</td>\n",
       "      <td>95.789474</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5455</td>\n",
       "      <td>1035909.80</td>\n",
       "      <td>1141853.833</td>\n",
       "      <td>79.381443</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.07</td>\n",
       "      <td>10.77</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.94</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5484</td>\n",
       "      <td>826631.10</td>\n",
       "      <td>904847.854</td>\n",
       "      <td>85.567010</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2019-01-02  000001.SZ   9.39   9.42   9.16   9.19       9.38   -0.19  -2.0256   \n",
       "2019-01-03  000001.SZ   9.18   9.33   9.15   9.28       9.19    0.09   0.9793   \n",
       "2019-01-04  000001.SZ   9.24   9.82   9.22   9.75       9.28    0.47   5.0647   \n",
       "2019-01-07  000001.SZ   9.84   9.85   9.63   9.74       9.75   -0.01  -0.1026   \n",
       "2019-01-08  000001.SZ   9.73   9.74   9.62   9.66       9.74   -0.08  -0.8214   \n",
       "2019-01-09  000001.SZ   9.74  10.08   9.70   9.94       9.66    0.28   2.8986   \n",
       "2019-01-10  000001.SZ   9.87  10.20   9.86  10.10       9.94    0.16   1.6097   \n",
       "2019-01-11  000001.SZ  10.11  10.22  10.05  10.20      10.10    0.10   0.9901   \n",
       "2019-01-14  000001.SZ  10.22  10.25  10.07  10.11      10.20   -0.09  -0.8824   \n",
       "2019-01-15  000001.SZ  10.11  10.28  10.09  10.24      10.11    0.13   1.2859   \n",
       "2019-01-16  000001.SZ  10.24  10.50  10.23  10.48      10.24    0.24   2.3438   \n",
       "2019-01-17  000001.SZ  10.54  10.57  10.17  10.25      10.48   -0.23  -2.1947   \n",
       "2019-01-18  000001.SZ  10.34  10.49  10.28  10.43      10.25    0.18   1.7561   \n",
       "2019-01-21  000001.SZ  10.34  10.47  10.32  10.34      10.43   -0.09  -0.8629   \n",
       "2019-01-22  000001.SZ  10.34  10.44  10.26  10.28      10.34   -0.06  -0.5803   \n",
       "2019-01-23  000001.SZ  10.29  10.47  10.29  10.35      10.28    0.07   0.6809   \n",
       "2019-01-24  000001.SZ  10.40  10.55  10.37  10.52      10.35    0.17   1.6425   \n",
       "2019-01-25  000001.SZ  10.56  11.04  10.55  11.00      10.52    0.48   4.5627   \n",
       "2019-01-28  000001.SZ  11.04  11.14  10.88  10.94      11.00   -0.06  -0.5455   \n",
       "2019-01-29  000001.SZ  10.96  11.07  10.77  11.00      10.94    0.06   0.5484   \n",
       "\n",
       "                   vol       amount        RSV  \n",
       "trade_date                                      \n",
       "2019-01-02   539386.32   498695.109        NaN  \n",
       "2019-01-03   415537.95   384457.707        NaN  \n",
       "2019-01-04  1481159.06  1422149.888        NaN  \n",
       "2019-01-07   865687.66   841166.430        NaN  \n",
       "2019-01-08   402388.11   389247.795        NaN  \n",
       "2019-01-09  1233486.36  1229465.116        NaN  \n",
       "2019-01-10  1071817.66  1079711.035        NaN  \n",
       "2019-01-11   696364.55   708001.802        NaN  \n",
       "2019-01-14   500443.59   507862.882  87.272727  \n",
       "2019-01-15   542160.55   553027.309  96.460177  \n",
       "2019-01-16   977699.37  1017495.116  98.437500  \n",
       "2019-01-17   882811.92   910212.066  66.315789  \n",
       "2019-01-18   738793.26   769973.637  85.263158  \n",
       "2019-01-21   659355.76   684465.646  73.563218  \n",
       "2019-01-22   424413.57   438991.450  59.154930  \n",
       "2019-01-23   537876.63   559384.396  57.692308  \n",
       "2019-01-24   679240.88   711495.718  90.000000  \n",
       "2019-01-25  2108361.85  2299718.224  95.789474  \n",
       "2019-01-28  1035909.80  1141853.833  79.381443  \n",
       "2019-01-29   826631.10   904847.854  85.567010  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole.head(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$K_t = \\frac{2}{3}*K_{t-1}+\\frac{1}{3}*RSV_t$ <br>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole['K'] = RSV.ewm(com=2).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>RSV</th>\n",
       "      <th>K</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-02</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.39</td>\n",
       "      <td>9.42</td>\n",
       "      <td>9.16</td>\n",
       "      <td>9.19</td>\n",
       "      <td>9.38</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-2.0256</td>\n",
       "      <td>539386.32</td>\n",
       "      <td>498695.109</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-03</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.18</td>\n",
       "      <td>9.33</td>\n",
       "      <td>9.15</td>\n",
       "      <td>9.28</td>\n",
       "      <td>9.19</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.9793</td>\n",
       "      <td>415537.95</td>\n",
       "      <td>384457.707</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-04</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.24</td>\n",
       "      <td>9.82</td>\n",
       "      <td>9.22</td>\n",
       "      <td>9.75</td>\n",
       "      <td>9.28</td>\n",
       "      <td>0.47</td>\n",
       "      <td>5.0647</td>\n",
       "      <td>1481159.06</td>\n",
       "      <td>1422149.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.84</td>\n",
       "      <td>9.85</td>\n",
       "      <td>9.63</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.75</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.1026</td>\n",
       "      <td>865687.66</td>\n",
       "      <td>841166.430</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.73</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.62</td>\n",
       "      <td>9.66</td>\n",
       "      <td>9.74</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.8214</td>\n",
       "      <td>402388.11</td>\n",
       "      <td>389247.795</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-09</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.74</td>\n",
       "      <td>10.08</td>\n",
       "      <td>9.70</td>\n",
       "      <td>9.94</td>\n",
       "      <td>9.66</td>\n",
       "      <td>0.28</td>\n",
       "      <td>2.8986</td>\n",
       "      <td>1233486.36</td>\n",
       "      <td>1229465.116</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-10</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.87</td>\n",
       "      <td>10.20</td>\n",
       "      <td>9.86</td>\n",
       "      <td>10.10</td>\n",
       "      <td>9.94</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.6097</td>\n",
       "      <td>1071817.66</td>\n",
       "      <td>1079711.035</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.20</td>\n",
       "      <td>10.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.9901</td>\n",
       "      <td>696364.55</td>\n",
       "      <td>708001.802</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.07</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.20</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8824</td>\n",
       "      <td>500443.59</td>\n",
       "      <td>507862.882</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.11</td>\n",
       "      <td>0.13</td>\n",
       "      <td>1.2859</td>\n",
       "      <td>542160.55</td>\n",
       "      <td>553027.309</td>\n",
       "      <td>96.460177</td>\n",
       "      <td>92.785197</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.23</td>\n",
       "      <td>10.48</td>\n",
       "      <td>10.24</td>\n",
       "      <td>0.24</td>\n",
       "      <td>2.3438</td>\n",
       "      <td>977699.37</td>\n",
       "      <td>1017495.116</td>\n",
       "      <td>98.437500</td>\n",
       "      <td>95.462604</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.57</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.48</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.1947</td>\n",
       "      <td>882811.92</td>\n",
       "      <td>910212.066</td>\n",
       "      <td>66.315789</td>\n",
       "      <td>83.355466</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.49</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.43</td>\n",
       "      <td>10.25</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.7561</td>\n",
       "      <td>738793.26</td>\n",
       "      <td>769973.637</td>\n",
       "      <td>85.263158</td>\n",
       "      <td>84.087802</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.32</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.43</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8629</td>\n",
       "      <td>659355.76</td>\n",
       "      <td>684465.646</td>\n",
       "      <td>73.563218</td>\n",
       "      <td>80.241977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.44</td>\n",
       "      <td>10.26</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.34</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5803</td>\n",
       "      <td>424413.57</td>\n",
       "      <td>438991.450</td>\n",
       "      <td>59.154930</td>\n",
       "      <td>72.775995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.35</td>\n",
       "      <td>10.28</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.6809</td>\n",
       "      <td>537876.63</td>\n",
       "      <td>559384.396</td>\n",
       "      <td>57.692308</td>\n",
       "      <td>67.543953</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.40</td>\n",
       "      <td>10.55</td>\n",
       "      <td>10.37</td>\n",
       "      <td>10.52</td>\n",
       "      <td>10.35</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.6425</td>\n",
       "      <td>679240.88</td>\n",
       "      <td>711495.718</td>\n",
       "      <td>90.000000</td>\n",
       "      <td>75.229213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.56</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.55</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>4.5627</td>\n",
       "      <td>2108361.85</td>\n",
       "      <td>2299718.224</td>\n",
       "      <td>95.789474</td>\n",
       "      <td>82.203580</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5455</td>\n",
       "      <td>1035909.80</td>\n",
       "      <td>1141853.833</td>\n",
       "      <td>79.381443</td>\n",
       "      <td>81.251865</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.07</td>\n",
       "      <td>10.77</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.94</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5484</td>\n",
       "      <td>826631.10</td>\n",
       "      <td>904847.854</td>\n",
       "      <td>85.567010</td>\n",
       "      <td>82.701419</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2019-01-02  000001.SZ   9.39   9.42   9.16   9.19       9.38   -0.19  -2.0256   \n",
       "2019-01-03  000001.SZ   9.18   9.33   9.15   9.28       9.19    0.09   0.9793   \n",
       "2019-01-04  000001.SZ   9.24   9.82   9.22   9.75       9.28    0.47   5.0647   \n",
       "2019-01-07  000001.SZ   9.84   9.85   9.63   9.74       9.75   -0.01  -0.1026   \n",
       "2019-01-08  000001.SZ   9.73   9.74   9.62   9.66       9.74   -0.08  -0.8214   \n",
       "2019-01-09  000001.SZ   9.74  10.08   9.70   9.94       9.66    0.28   2.8986   \n",
       "2019-01-10  000001.SZ   9.87  10.20   9.86  10.10       9.94    0.16   1.6097   \n",
       "2019-01-11  000001.SZ  10.11  10.22  10.05  10.20      10.10    0.10   0.9901   \n",
       "2019-01-14  000001.SZ  10.22  10.25  10.07  10.11      10.20   -0.09  -0.8824   \n",
       "2019-01-15  000001.SZ  10.11  10.28  10.09  10.24      10.11    0.13   1.2859   \n",
       "2019-01-16  000001.SZ  10.24  10.50  10.23  10.48      10.24    0.24   2.3438   \n",
       "2019-01-17  000001.SZ  10.54  10.57  10.17  10.25      10.48   -0.23  -2.1947   \n",
       "2019-01-18  000001.SZ  10.34  10.49  10.28  10.43      10.25    0.18   1.7561   \n",
       "2019-01-21  000001.SZ  10.34  10.47  10.32  10.34      10.43   -0.09  -0.8629   \n",
       "2019-01-22  000001.SZ  10.34  10.44  10.26  10.28      10.34   -0.06  -0.5803   \n",
       "2019-01-23  000001.SZ  10.29  10.47  10.29  10.35      10.28    0.07   0.6809   \n",
       "2019-01-24  000001.SZ  10.40  10.55  10.37  10.52      10.35    0.17   1.6425   \n",
       "2019-01-25  000001.SZ  10.56  11.04  10.55  11.00      10.52    0.48   4.5627   \n",
       "2019-01-28  000001.SZ  11.04  11.14  10.88  10.94      11.00   -0.06  -0.5455   \n",
       "2019-01-29  000001.SZ  10.96  11.07  10.77  11.00      10.94    0.06   0.5484   \n",
       "\n",
       "                   vol       amount        RSV          K  \n",
       "trade_date                                                 \n",
       "2019-01-02   539386.32   498695.109        NaN        NaN  \n",
       "2019-01-03   415537.95   384457.707        NaN        NaN  \n",
       "2019-01-04  1481159.06  1422149.888        NaN        NaN  \n",
       "2019-01-07   865687.66   841166.430        NaN        NaN  \n",
       "2019-01-08   402388.11   389247.795        NaN        NaN  \n",
       "2019-01-09  1233486.36  1229465.116        NaN        NaN  \n",
       "2019-01-10  1071817.66  1079711.035        NaN        NaN  \n",
       "2019-01-11   696364.55   708001.802        NaN        NaN  \n",
       "2019-01-14   500443.59   507862.882  87.272727  87.272727  \n",
       "2019-01-15   542160.55   553027.309  96.460177  92.785197  \n",
       "2019-01-16   977699.37  1017495.116  98.437500  95.462604  \n",
       "2019-01-17   882811.92   910212.066  66.315789  83.355466  \n",
       "2019-01-18   738793.26   769973.637  85.263158  84.087802  \n",
       "2019-01-21   659355.76   684465.646  73.563218  80.241977  \n",
       "2019-01-22   424413.57   438991.450  59.154930  72.775995  \n",
       "2019-01-23   537876.63   559384.396  57.692308  67.543953  \n",
       "2019-01-24   679240.88   711495.718  90.000000  75.229213  \n",
       "2019-01-25  2108361.85  2299718.224  95.789474  82.203580  \n",
       "2019-01-28  1035909.80  1141853.833  79.381443  81.251865  \n",
       "2019-01-29   826631.10   904847.854  85.567010  82.701419  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole.head(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$D_t = \\frac{2}{3}*D_{t-1}+\\frac{1}{3}*K_t$ <br>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole['D'] = df_whole['K'].ewm(com=2).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>RSV</th>\n",
       "      <th>K</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-02</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.39</td>\n",
       "      <td>9.42</td>\n",
       "      <td>9.16</td>\n",
       "      <td>9.19</td>\n",
       "      <td>9.38</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-2.0256</td>\n",
       "      <td>539386.32</td>\n",
       "      <td>498695.109</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-03</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.18</td>\n",
       "      <td>9.33</td>\n",
       "      <td>9.15</td>\n",
       "      <td>9.28</td>\n",
       "      <td>9.19</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.9793</td>\n",
       "      <td>415537.95</td>\n",
       "      <td>384457.707</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-04</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.24</td>\n",
       "      <td>9.82</td>\n",
       "      <td>9.22</td>\n",
       "      <td>9.75</td>\n",
       "      <td>9.28</td>\n",
       "      <td>0.47</td>\n",
       "      <td>5.0647</td>\n",
       "      <td>1481159.06</td>\n",
       "      <td>1422149.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.84</td>\n",
       "      <td>9.85</td>\n",
       "      <td>9.63</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.75</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.1026</td>\n",
       "      <td>865687.66</td>\n",
       "      <td>841166.430</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.73</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.62</td>\n",
       "      <td>9.66</td>\n",
       "      <td>9.74</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.8214</td>\n",
       "      <td>402388.11</td>\n",
       "      <td>389247.795</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-09</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.74</td>\n",
       "      <td>10.08</td>\n",
       "      <td>9.70</td>\n",
       "      <td>9.94</td>\n",
       "      <td>9.66</td>\n",
       "      <td>0.28</td>\n",
       "      <td>2.8986</td>\n",
       "      <td>1233486.36</td>\n",
       "      <td>1229465.116</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-10</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.87</td>\n",
       "      <td>10.20</td>\n",
       "      <td>9.86</td>\n",
       "      <td>10.10</td>\n",
       "      <td>9.94</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.6097</td>\n",
       "      <td>1071817.66</td>\n",
       "      <td>1079711.035</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.20</td>\n",
       "      <td>10.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.9901</td>\n",
       "      <td>696364.55</td>\n",
       "      <td>708001.802</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.07</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.20</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8824</td>\n",
       "      <td>500443.59</td>\n",
       "      <td>507862.882</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.11</td>\n",
       "      <td>0.13</td>\n",
       "      <td>1.2859</td>\n",
       "      <td>542160.55</td>\n",
       "      <td>553027.309</td>\n",
       "      <td>96.460177</td>\n",
       "      <td>92.785197</td>\n",
       "      <td>90.580209</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.23</td>\n",
       "      <td>10.48</td>\n",
       "      <td>10.24</td>\n",
       "      <td>0.24</td>\n",
       "      <td>2.3438</td>\n",
       "      <td>977699.37</td>\n",
       "      <td>1017495.116</td>\n",
       "      <td>98.437500</td>\n",
       "      <td>95.462604</td>\n",
       "      <td>92.892922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.57</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.48</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.1947</td>\n",
       "      <td>882811.92</td>\n",
       "      <td>910212.066</td>\n",
       "      <td>66.315789</td>\n",
       "      <td>83.355466</td>\n",
       "      <td>88.931210</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.49</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.43</td>\n",
       "      <td>10.25</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.7561</td>\n",
       "      <td>738793.26</td>\n",
       "      <td>769973.637</td>\n",
       "      <td>85.263158</td>\n",
       "      <td>84.087802</td>\n",
       "      <td>87.071892</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.32</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.43</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8629</td>\n",
       "      <td>659355.76</td>\n",
       "      <td>684465.646</td>\n",
       "      <td>73.563218</td>\n",
       "      <td>80.241977</td>\n",
       "      <td>84.576149</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.44</td>\n",
       "      <td>10.26</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.34</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5803</td>\n",
       "      <td>424413.57</td>\n",
       "      <td>438991.450</td>\n",
       "      <td>59.154930</td>\n",
       "      <td>72.775995</td>\n",
       "      <td>80.398241</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.35</td>\n",
       "      <td>10.28</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.6809</td>\n",
       "      <td>537876.63</td>\n",
       "      <td>559384.396</td>\n",
       "      <td>57.692308</td>\n",
       "      <td>67.543953</td>\n",
       "      <td>75.939505</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.40</td>\n",
       "      <td>10.55</td>\n",
       "      <td>10.37</td>\n",
       "      <td>10.52</td>\n",
       "      <td>10.35</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.6425</td>\n",
       "      <td>679240.88</td>\n",
       "      <td>711495.718</td>\n",
       "      <td>90.000000</td>\n",
       "      <td>75.229213</td>\n",
       "      <td>75.696418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.56</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.55</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>4.5627</td>\n",
       "      <td>2108361.85</td>\n",
       "      <td>2299718.224</td>\n",
       "      <td>95.789474</td>\n",
       "      <td>82.203580</td>\n",
       "      <td>77.903750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5455</td>\n",
       "      <td>1035909.80</td>\n",
       "      <td>1141853.833</td>\n",
       "      <td>79.381443</td>\n",
       "      <td>81.251865</td>\n",
       "      <td>79.032842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.07</td>\n",
       "      <td>10.77</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.94</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5484</td>\n",
       "      <td>826631.10</td>\n",
       "      <td>904847.854</td>\n",
       "      <td>85.567010</td>\n",
       "      <td>82.701419</td>\n",
       "      <td>80.265199</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2019-01-02  000001.SZ   9.39   9.42   9.16   9.19       9.38   -0.19  -2.0256   \n",
       "2019-01-03  000001.SZ   9.18   9.33   9.15   9.28       9.19    0.09   0.9793   \n",
       "2019-01-04  000001.SZ   9.24   9.82   9.22   9.75       9.28    0.47   5.0647   \n",
       "2019-01-07  000001.SZ   9.84   9.85   9.63   9.74       9.75   -0.01  -0.1026   \n",
       "2019-01-08  000001.SZ   9.73   9.74   9.62   9.66       9.74   -0.08  -0.8214   \n",
       "2019-01-09  000001.SZ   9.74  10.08   9.70   9.94       9.66    0.28   2.8986   \n",
       "2019-01-10  000001.SZ   9.87  10.20   9.86  10.10       9.94    0.16   1.6097   \n",
       "2019-01-11  000001.SZ  10.11  10.22  10.05  10.20      10.10    0.10   0.9901   \n",
       "2019-01-14  000001.SZ  10.22  10.25  10.07  10.11      10.20   -0.09  -0.8824   \n",
       "2019-01-15  000001.SZ  10.11  10.28  10.09  10.24      10.11    0.13   1.2859   \n",
       "2019-01-16  000001.SZ  10.24  10.50  10.23  10.48      10.24    0.24   2.3438   \n",
       "2019-01-17  000001.SZ  10.54  10.57  10.17  10.25      10.48   -0.23  -2.1947   \n",
       "2019-01-18  000001.SZ  10.34  10.49  10.28  10.43      10.25    0.18   1.7561   \n",
       "2019-01-21  000001.SZ  10.34  10.47  10.32  10.34      10.43   -0.09  -0.8629   \n",
       "2019-01-22  000001.SZ  10.34  10.44  10.26  10.28      10.34   -0.06  -0.5803   \n",
       "2019-01-23  000001.SZ  10.29  10.47  10.29  10.35      10.28    0.07   0.6809   \n",
       "2019-01-24  000001.SZ  10.40  10.55  10.37  10.52      10.35    0.17   1.6425   \n",
       "2019-01-25  000001.SZ  10.56  11.04  10.55  11.00      10.52    0.48   4.5627   \n",
       "2019-01-28  000001.SZ  11.04  11.14  10.88  10.94      11.00   -0.06  -0.5455   \n",
       "2019-01-29  000001.SZ  10.96  11.07  10.77  11.00      10.94    0.06   0.5484   \n",
       "\n",
       "                   vol       amount        RSV          K          D  \n",
       "trade_date                                                            \n",
       "2019-01-02   539386.32   498695.109        NaN        NaN        NaN  \n",
       "2019-01-03   415537.95   384457.707        NaN        NaN        NaN  \n",
       "2019-01-04  1481159.06  1422149.888        NaN        NaN        NaN  \n",
       "2019-01-07   865687.66   841166.430        NaN        NaN        NaN  \n",
       "2019-01-08   402388.11   389247.795        NaN        NaN        NaN  \n",
       "2019-01-09  1233486.36  1229465.116        NaN        NaN        NaN  \n",
       "2019-01-10  1071817.66  1079711.035        NaN        NaN        NaN  \n",
       "2019-01-11   696364.55   708001.802        NaN        NaN        NaN  \n",
       "2019-01-14   500443.59   507862.882  87.272727  87.272727  87.272727  \n",
       "2019-01-15   542160.55   553027.309  96.460177  92.785197  90.580209  \n",
       "2019-01-16   977699.37  1017495.116  98.437500  95.462604  92.892922  \n",
       "2019-01-17   882811.92   910212.066  66.315789  83.355466  88.931210  \n",
       "2019-01-18   738793.26   769973.637  85.263158  84.087802  87.071892  \n",
       "2019-01-21   659355.76   684465.646  73.563218  80.241977  84.576149  \n",
       "2019-01-22   424413.57   438991.450  59.154930  72.775995  80.398241  \n",
       "2019-01-23   537876.63   559384.396  57.692308  67.543953  75.939505  \n",
       "2019-01-24   679240.88   711495.718  90.000000  75.229213  75.696418  \n",
       "2019-01-25  2108361.85  2299718.224  95.789474  82.203580  77.903750  \n",
       "2019-01-28  1035909.80  1141853.833  79.381443  81.251865  79.032842  \n",
       "2019-01-29   826631.10   904847.854  85.567010  82.701419  80.265199  "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole.head(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$J_t = 3* K_{t}-2*D_{t} $"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole['J'] = 3* df_whole['K'] - 2* df_whole['D']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>RSV</th>\n",
       "      <th>K</th>\n",
       "      <th>D</th>\n",
       "      <th>J</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-02</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.39</td>\n",
       "      <td>9.42</td>\n",
       "      <td>9.16</td>\n",
       "      <td>9.19</td>\n",
       "      <td>9.38</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-2.0256</td>\n",
       "      <td>539386.32</td>\n",
       "      <td>498695.109</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-03</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.18</td>\n",
       "      <td>9.33</td>\n",
       "      <td>9.15</td>\n",
       "      <td>9.28</td>\n",
       "      <td>9.19</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.9793</td>\n",
       "      <td>415537.95</td>\n",
       "      <td>384457.707</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-04</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.24</td>\n",
       "      <td>9.82</td>\n",
       "      <td>9.22</td>\n",
       "      <td>9.75</td>\n",
       "      <td>9.28</td>\n",
       "      <td>0.47</td>\n",
       "      <td>5.0647</td>\n",
       "      <td>1481159.06</td>\n",
       "      <td>1422149.888</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.84</td>\n",
       "      <td>9.85</td>\n",
       "      <td>9.63</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.75</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.1026</td>\n",
       "      <td>865687.66</td>\n",
       "      <td>841166.430</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.73</td>\n",
       "      <td>9.74</td>\n",
       "      <td>9.62</td>\n",
       "      <td>9.66</td>\n",
       "      <td>9.74</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.8214</td>\n",
       "      <td>402388.11</td>\n",
       "      <td>389247.795</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-09</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.74</td>\n",
       "      <td>10.08</td>\n",
       "      <td>9.70</td>\n",
       "      <td>9.94</td>\n",
       "      <td>9.66</td>\n",
       "      <td>0.28</td>\n",
       "      <td>2.8986</td>\n",
       "      <td>1233486.36</td>\n",
       "      <td>1229465.116</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-10</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>9.87</td>\n",
       "      <td>10.20</td>\n",
       "      <td>9.86</td>\n",
       "      <td>10.10</td>\n",
       "      <td>9.94</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.6097</td>\n",
       "      <td>1071817.66</td>\n",
       "      <td>1079711.035</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.20</td>\n",
       "      <td>10.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.9901</td>\n",
       "      <td>696364.55</td>\n",
       "      <td>708001.802</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.07</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.20</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8824</td>\n",
       "      <td>500443.59</td>\n",
       "      <td>507862.882</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.11</td>\n",
       "      <td>0.13</td>\n",
       "      <td>1.2859</td>\n",
       "      <td>542160.55</td>\n",
       "      <td>553027.309</td>\n",
       "      <td>96.460177</td>\n",
       "      <td>92.785197</td>\n",
       "      <td>90.580209</td>\n",
       "      <td>97.195173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.23</td>\n",
       "      <td>10.48</td>\n",
       "      <td>10.24</td>\n",
       "      <td>0.24</td>\n",
       "      <td>2.3438</td>\n",
       "      <td>977699.37</td>\n",
       "      <td>1017495.116</td>\n",
       "      <td>98.437500</td>\n",
       "      <td>95.462604</td>\n",
       "      <td>92.892922</td>\n",
       "      <td>100.601966</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.57</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.48</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.1947</td>\n",
       "      <td>882811.92</td>\n",
       "      <td>910212.066</td>\n",
       "      <td>66.315789</td>\n",
       "      <td>83.355466</td>\n",
       "      <td>88.931210</td>\n",
       "      <td>72.203977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.49</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.43</td>\n",
       "      <td>10.25</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.7561</td>\n",
       "      <td>738793.26</td>\n",
       "      <td>769973.637</td>\n",
       "      <td>85.263158</td>\n",
       "      <td>84.087802</td>\n",
       "      <td>87.071892</td>\n",
       "      <td>78.119623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.32</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.43</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8629</td>\n",
       "      <td>659355.76</td>\n",
       "      <td>684465.646</td>\n",
       "      <td>73.563218</td>\n",
       "      <td>80.241977</td>\n",
       "      <td>84.576149</td>\n",
       "      <td>71.573634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.44</td>\n",
       "      <td>10.26</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.34</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5803</td>\n",
       "      <td>424413.57</td>\n",
       "      <td>438991.450</td>\n",
       "      <td>59.154930</td>\n",
       "      <td>72.775995</td>\n",
       "      <td>80.398241</td>\n",
       "      <td>57.531502</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.35</td>\n",
       "      <td>10.28</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.6809</td>\n",
       "      <td>537876.63</td>\n",
       "      <td>559384.396</td>\n",
       "      <td>57.692308</td>\n",
       "      <td>67.543953</td>\n",
       "      <td>75.939505</td>\n",
       "      <td>50.752848</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.40</td>\n",
       "      <td>10.55</td>\n",
       "      <td>10.37</td>\n",
       "      <td>10.52</td>\n",
       "      <td>10.35</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.6425</td>\n",
       "      <td>679240.88</td>\n",
       "      <td>711495.718</td>\n",
       "      <td>90.000000</td>\n",
       "      <td>75.229213</td>\n",
       "      <td>75.696418</td>\n",
       "      <td>74.294804</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.56</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.55</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>4.5627</td>\n",
       "      <td>2108361.85</td>\n",
       "      <td>2299718.224</td>\n",
       "      <td>95.789474</td>\n",
       "      <td>82.203580</td>\n",
       "      <td>77.903750</td>\n",
       "      <td>90.803238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5455</td>\n",
       "      <td>1035909.80</td>\n",
       "      <td>1141853.833</td>\n",
       "      <td>79.381443</td>\n",
       "      <td>81.251865</td>\n",
       "      <td>79.032842</td>\n",
       "      <td>85.689910</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.07</td>\n",
       "      <td>10.77</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.94</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5484</td>\n",
       "      <td>826631.10</td>\n",
       "      <td>904847.854</td>\n",
       "      <td>85.567010</td>\n",
       "      <td>82.701419</td>\n",
       "      <td>80.265199</td>\n",
       "      <td>87.573858</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2019-01-02  000001.SZ   9.39   9.42   9.16   9.19       9.38   -0.19  -2.0256   \n",
       "2019-01-03  000001.SZ   9.18   9.33   9.15   9.28       9.19    0.09   0.9793   \n",
       "2019-01-04  000001.SZ   9.24   9.82   9.22   9.75       9.28    0.47   5.0647   \n",
       "2019-01-07  000001.SZ   9.84   9.85   9.63   9.74       9.75   -0.01  -0.1026   \n",
       "2019-01-08  000001.SZ   9.73   9.74   9.62   9.66       9.74   -0.08  -0.8214   \n",
       "2019-01-09  000001.SZ   9.74  10.08   9.70   9.94       9.66    0.28   2.8986   \n",
       "2019-01-10  000001.SZ   9.87  10.20   9.86  10.10       9.94    0.16   1.6097   \n",
       "2019-01-11  000001.SZ  10.11  10.22  10.05  10.20      10.10    0.10   0.9901   \n",
       "2019-01-14  000001.SZ  10.22  10.25  10.07  10.11      10.20   -0.09  -0.8824   \n",
       "2019-01-15  000001.SZ  10.11  10.28  10.09  10.24      10.11    0.13   1.2859   \n",
       "2019-01-16  000001.SZ  10.24  10.50  10.23  10.48      10.24    0.24   2.3438   \n",
       "2019-01-17  000001.SZ  10.54  10.57  10.17  10.25      10.48   -0.23  -2.1947   \n",
       "2019-01-18  000001.SZ  10.34  10.49  10.28  10.43      10.25    0.18   1.7561   \n",
       "2019-01-21  000001.SZ  10.34  10.47  10.32  10.34      10.43   -0.09  -0.8629   \n",
       "2019-01-22  000001.SZ  10.34  10.44  10.26  10.28      10.34   -0.06  -0.5803   \n",
       "2019-01-23  000001.SZ  10.29  10.47  10.29  10.35      10.28    0.07   0.6809   \n",
       "2019-01-24  000001.SZ  10.40  10.55  10.37  10.52      10.35    0.17   1.6425   \n",
       "2019-01-25  000001.SZ  10.56  11.04  10.55  11.00      10.52    0.48   4.5627   \n",
       "2019-01-28  000001.SZ  11.04  11.14  10.88  10.94      11.00   -0.06  -0.5455   \n",
       "2019-01-29  000001.SZ  10.96  11.07  10.77  11.00      10.94    0.06   0.5484   \n",
       "\n",
       "                   vol       amount        RSV          K          D  \\\n",
       "trade_date                                                             \n",
       "2019-01-02   539386.32   498695.109        NaN        NaN        NaN   \n",
       "2019-01-03   415537.95   384457.707        NaN        NaN        NaN   \n",
       "2019-01-04  1481159.06  1422149.888        NaN        NaN        NaN   \n",
       "2019-01-07   865687.66   841166.430        NaN        NaN        NaN   \n",
       "2019-01-08   402388.11   389247.795        NaN        NaN        NaN   \n",
       "2019-01-09  1233486.36  1229465.116        NaN        NaN        NaN   \n",
       "2019-01-10  1071817.66  1079711.035        NaN        NaN        NaN   \n",
       "2019-01-11   696364.55   708001.802        NaN        NaN        NaN   \n",
       "2019-01-14   500443.59   507862.882  87.272727  87.272727  87.272727   \n",
       "2019-01-15   542160.55   553027.309  96.460177  92.785197  90.580209   \n",
       "2019-01-16   977699.37  1017495.116  98.437500  95.462604  92.892922   \n",
       "2019-01-17   882811.92   910212.066  66.315789  83.355466  88.931210   \n",
       "2019-01-18   738793.26   769973.637  85.263158  84.087802  87.071892   \n",
       "2019-01-21   659355.76   684465.646  73.563218  80.241977  84.576149   \n",
       "2019-01-22   424413.57   438991.450  59.154930  72.775995  80.398241   \n",
       "2019-01-23   537876.63   559384.396  57.692308  67.543953  75.939505   \n",
       "2019-01-24   679240.88   711495.718  90.000000  75.229213  75.696418   \n",
       "2019-01-25  2108361.85  2299718.224  95.789474  82.203580  77.903750   \n",
       "2019-01-28  1035909.80  1141853.833  79.381443  81.251865  79.032842   \n",
       "2019-01-29   826631.10   904847.854  85.567010  82.701419  80.265199   \n",
       "\n",
       "                     J  \n",
       "trade_date              \n",
       "2019-01-02         NaN  \n",
       "2019-01-03         NaN  \n",
       "2019-01-04         NaN  \n",
       "2019-01-07         NaN  \n",
       "2019-01-08         NaN  \n",
       "2019-01-09         NaN  \n",
       "2019-01-10         NaN  \n",
       "2019-01-11         NaN  \n",
       "2019-01-14   87.272727  \n",
       "2019-01-15   97.195173  \n",
       "2019-01-16  100.601966  \n",
       "2019-01-17   72.203977  \n",
       "2019-01-18   78.119623  \n",
       "2019-01-21   71.573634  \n",
       "2019-01-22   57.531502  \n",
       "2019-01-23   50.752848  \n",
       "2019-01-24   74.294804  \n",
       "2019-01-25   90.803238  \n",
       "2019-01-28   85.689910  \n",
       "2019-01-29   87.573858  "
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole.head(20)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib notebook"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>K</th>\n",
       "      <th>D</th>\n",
       "      <th>J</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>92.785197</td>\n",
       "      <td>90.580209</td>\n",
       "      <td>97.195173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>95.462604</td>\n",
       "      <td>92.892922</td>\n",
       "      <td>100.601966</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>83.355466</td>\n",
       "      <td>88.931210</td>\n",
       "      <td>72.203977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>84.087802</td>\n",
       "      <td>87.071892</td>\n",
       "      <td>78.119623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>80.241977</td>\n",
       "      <td>84.576149</td>\n",
       "      <td>71.573634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>72.775995</td>\n",
       "      <td>80.398241</td>\n",
       "      <td>57.531502</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>67.543953</td>\n",
       "      <td>75.939505</td>\n",
       "      <td>50.752848</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>75.229213</td>\n",
       "      <td>75.696418</td>\n",
       "      <td>74.294804</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>82.203580</td>\n",
       "      <td>77.903750</td>\n",
       "      <td>90.803238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>81.251865</td>\n",
       "      <td>79.032842</td>\n",
       "      <td>85.689910</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>82.701419</td>\n",
       "      <td>80.265199</td>\n",
       "      <td>87.573858</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-30</th>\n",
       "      <td>80.121020</td>\n",
       "      <td>80.216891</td>\n",
       "      <td>79.929279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>83.211835</td>\n",
       "      <td>81.218637</td>\n",
       "      <td>87.198231</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-01</th>\n",
       "      <td>87.133344</td>\n",
       "      <td>83.194719</td>\n",
       "      <td>95.010594</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-11</th>\n",
       "      <td>90.037762</td>\n",
       "      <td>85.479211</td>\n",
       "      <td>99.154864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-12</th>\n",
       "      <td>89.102239</td>\n",
       "      <td>86.688114</td>\n",
       "      <td>93.930490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-13</th>\n",
       "      <td>91.573708</td>\n",
       "      <td>88.317748</td>\n",
       "      <td>98.085627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-14</th>\n",
       "      <td>86.046645</td>\n",
       "      <td>87.560372</td>\n",
       "      <td>83.019192</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-15</th>\n",
       "      <td>66.733622</td>\n",
       "      <td>80.616034</td>\n",
       "      <td>38.968799</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-18</th>\n",
       "      <td>74.793728</td>\n",
       "      <td>78.674876</td>\n",
       "      <td>67.031431</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-19</th>\n",
       "      <td>66.991072</td>\n",
       "      <td>74.779754</td>\n",
       "      <td>51.413708</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-20</th>\n",
       "      <td>68.271940</td>\n",
       "      <td>72.610289</td>\n",
       "      <td>59.595241</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-21</th>\n",
       "      <td>66.810836</td>\n",
       "      <td>70.677023</td>\n",
       "      <td>59.078461</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-22</th>\n",
       "      <td>74.170478</td>\n",
       "      <td>71.841555</td>\n",
       "      <td>78.828326</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-25</th>\n",
       "      <td>81.056363</td>\n",
       "      <td>74.913238</td>\n",
       "      <td>93.342612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-26</th>\n",
       "      <td>78.941753</td>\n",
       "      <td>76.256100</td>\n",
       "      <td>84.313058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-27</th>\n",
       "      <td>81.036951</td>\n",
       "      <td>77.849736</td>\n",
       "      <td>87.411380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>81.185129</td>\n",
       "      <td>78.961542</td>\n",
       "      <td>85.632302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-01</th>\n",
       "      <td>87.047785</td>\n",
       "      <td>81.656970</td>\n",
       "      <td>97.829414</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-08</th>\n",
       "      <td>40.903345</td>\n",
       "      <td>46.958157</td>\n",
       "      <td>28.793722</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-09</th>\n",
       "      <td>34.899419</td>\n",
       "      <td>42.938578</td>\n",
       "      <td>18.821102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-10</th>\n",
       "      <td>37.059383</td>\n",
       "      <td>40.978846</td>\n",
       "      <td>29.220456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-13</th>\n",
       "      <td>30.766861</td>\n",
       "      <td>37.574851</td>\n",
       "      <td>17.150882</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-14</th>\n",
       "      <td>40.208211</td>\n",
       "      <td>38.452638</td>\n",
       "      <td>43.719356</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-15</th>\n",
       "      <td>52.949265</td>\n",
       "      <td>43.284847</td>\n",
       "      <td>72.278100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-16</th>\n",
       "      <td>49.025000</td>\n",
       "      <td>45.198231</td>\n",
       "      <td>56.678538</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-17</th>\n",
       "      <td>57.244737</td>\n",
       "      <td>49.213733</td>\n",
       "      <td>73.306744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-20</th>\n",
       "      <td>68.048215</td>\n",
       "      <td>55.491894</td>\n",
       "      <td>93.160859</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-21</th>\n",
       "      <td>71.923742</td>\n",
       "      <td>60.969177</td>\n",
       "      <td>93.832874</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-22</th>\n",
       "      <td>68.545368</td>\n",
       "      <td>63.494574</td>\n",
       "      <td>78.646956</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-23</th>\n",
       "      <td>66.293118</td>\n",
       "      <td>64.427422</td>\n",
       "      <td>70.024510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-24</th>\n",
       "      <td>64.310354</td>\n",
       "      <td>64.388399</td>\n",
       "      <td>64.154265</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-27</th>\n",
       "      <td>70.459776</td>\n",
       "      <td>66.412192</td>\n",
       "      <td>78.554946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-28</th>\n",
       "      <td>75.134104</td>\n",
       "      <td>69.319496</td>\n",
       "      <td>86.763320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-29</th>\n",
       "      <td>81.583655</td>\n",
       "      <td>73.407549</td>\n",
       "      <td>97.935868</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-30</th>\n",
       "      <td>79.335340</td>\n",
       "      <td>75.383479</td>\n",
       "      <td>87.239062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-06</th>\n",
       "      <td>71.072045</td>\n",
       "      <td>73.946335</td>\n",
       "      <td>65.323466</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-07</th>\n",
       "      <td>63.359325</td>\n",
       "      <td>70.417331</td>\n",
       "      <td>49.243312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-08</th>\n",
       "      <td>65.380046</td>\n",
       "      <td>68.738236</td>\n",
       "      <td>58.663665</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-11</th>\n",
       "      <td>68.104603</td>\n",
       "      <td>68.527025</td>\n",
       "      <td>67.259760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-12</th>\n",
       "      <td>62.225499</td>\n",
       "      <td>66.426516</td>\n",
       "      <td>53.823464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-13</th>\n",
       "      <td>52.912237</td>\n",
       "      <td>61.921757</td>\n",
       "      <td>34.893199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-14</th>\n",
       "      <td>37.699067</td>\n",
       "      <td>53.847527</td>\n",
       "      <td>5.402148</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-15</th>\n",
       "      <td>27.675084</td>\n",
       "      <td>45.123379</td>\n",
       "      <td>-7.221506</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-18</th>\n",
       "      <td>21.090320</td>\n",
       "      <td>37.112360</td>\n",
       "      <td>-10.953759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-19</th>\n",
       "      <td>21.981006</td>\n",
       "      <td>32.068575</td>\n",
       "      <td>1.805867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-20</th>\n",
       "      <td>27.525291</td>\n",
       "      <td>30.554147</td>\n",
       "      <td>21.467579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-21</th>\n",
       "      <td>27.591118</td>\n",
       "      <td>29.566471</td>\n",
       "      <td>23.640413</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-22</th>\n",
       "      <td>18.394079</td>\n",
       "      <td>25.842340</td>\n",
       "      <td>3.497556</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>328 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                    K          D           J\n",
       "trade_date                                  \n",
       "2019-01-14  87.272727  87.272727   87.272727\n",
       "2019-01-15  92.785197  90.580209   97.195173\n",
       "2019-01-16  95.462604  92.892922  100.601966\n",
       "2019-01-17  83.355466  88.931210   72.203977\n",
       "2019-01-18  84.087802  87.071892   78.119623\n",
       "2019-01-21  80.241977  84.576149   71.573634\n",
       "2019-01-22  72.775995  80.398241   57.531502\n",
       "2019-01-23  67.543953  75.939505   50.752848\n",
       "2019-01-24  75.229213  75.696418   74.294804\n",
       "2019-01-25  82.203580  77.903750   90.803238\n",
       "2019-01-28  81.251865  79.032842   85.689910\n",
       "2019-01-29  82.701419  80.265199   87.573858\n",
       "2019-01-30  80.121020  80.216891   79.929279\n",
       "2019-01-31  83.211835  81.218637   87.198231\n",
       "2019-02-01  87.133344  83.194719   95.010594\n",
       "2019-02-11  90.037762  85.479211   99.154864\n",
       "2019-02-12  89.102239  86.688114   93.930490\n",
       "2019-02-13  91.573708  88.317748   98.085627\n",
       "2019-02-14  86.046645  87.560372   83.019192\n",
       "2019-02-15  66.733622  80.616034   38.968799\n",
       "2019-02-18  74.793728  78.674876   67.031431\n",
       "2019-02-19  66.991072  74.779754   51.413708\n",
       "2019-02-20  68.271940  72.610289   59.595241\n",
       "2019-02-21  66.810836  70.677023   59.078461\n",
       "2019-02-22  74.170478  71.841555   78.828326\n",
       "2019-02-25  81.056363  74.913238   93.342612\n",
       "2019-02-26  78.941753  76.256100   84.313058\n",
       "2019-02-27  81.036951  77.849736   87.411380\n",
       "2019-02-28  81.185129  78.961542   85.632302\n",
       "2019-03-01  87.047785  81.656970   97.829414\n",
       "...               ...        ...         ...\n",
       "2020-04-08  40.903345  46.958157   28.793722\n",
       "2020-04-09  34.899419  42.938578   18.821102\n",
       "2020-04-10  37.059383  40.978846   29.220456\n",
       "2020-04-13  30.766861  37.574851   17.150882\n",
       "2020-04-14  40.208211  38.452638   43.719356\n",
       "2020-04-15  52.949265  43.284847   72.278100\n",
       "2020-04-16  49.025000  45.198231   56.678538\n",
       "2020-04-17  57.244737  49.213733   73.306744\n",
       "2020-04-20  68.048215  55.491894   93.160859\n",
       "2020-04-21  71.923742  60.969177   93.832874\n",
       "2020-04-22  68.545368  63.494574   78.646956\n",
       "2020-04-23  66.293118  64.427422   70.024510\n",
       "2020-04-24  64.310354  64.388399   64.154265\n",
       "2020-04-27  70.459776  66.412192   78.554946\n",
       "2020-04-28  75.134104  69.319496   86.763320\n",
       "2020-04-29  81.583655  73.407549   97.935868\n",
       "2020-04-30  79.335340  75.383479   87.239062\n",
       "2020-05-06  71.072045  73.946335   65.323466\n",
       "2020-05-07  63.359325  70.417331   49.243312\n",
       "2020-05-08  65.380046  68.738236   58.663665\n",
       "2020-05-11  68.104603  68.527025   67.259760\n",
       "2020-05-12  62.225499  66.426516   53.823464\n",
       "2020-05-13  52.912237  61.921757   34.893199\n",
       "2020-05-14  37.699067  53.847527    5.402148\n",
       "2020-05-15  27.675084  45.123379   -7.221506\n",
       "2020-05-18  21.090320  37.112360  -10.953759\n",
       "2020-05-19  21.981006  32.068575    1.805867\n",
       "2020-05-20  27.525291  30.554147   21.467579\n",
       "2020-05-21  27.591118  29.566471   23.640413\n",
       "2020-05-22  18.394079  25.842340    3.497556\n",
       "\n",
       "[328 rows x 3 columns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "# df_whole[].dropna()\n",
    "df_whole[['K','D','J']].dropna()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "/* Put everything inside the global mpl namespace */\n",
       "window.mpl = {};\n",
       "\n",
       "\n",
       "mpl.get_websocket_type = function() {\n",
       "    if (typeof(WebSocket) !== 'undefined') {\n",
       "        return WebSocket;\n",
       "    } else if (typeof(MozWebSocket) !== 'undefined') {\n",
       "        return MozWebSocket;\n",
       "    } else {\n",
       "        alert('Your browser does not have WebSocket support. ' +\n",
       "              'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
       "              'Firefox 4 and 5 are also supported but you ' +\n",
       "              'have to enable WebSockets in about:config.');\n",
       "    };\n",
       "}\n",
       "\n",
       "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
       "    this.id = figure_id;\n",
       "\n",
       "    this.ws = websocket;\n",
       "\n",
       "    this.supports_binary = (this.ws.binaryType != undefined);\n",
       "\n",
       "    if (!this.supports_binary) {\n",
       "        var warnings = document.getElementById(\"mpl-warnings\");\n",
       "        if (warnings) {\n",
       "            warnings.style.display = 'block';\n",
       "            warnings.textContent = (\n",
       "                \"This browser does not support binary websocket messages. \" +\n",
       "                    \"Performance may be slow.\");\n",
       "        }\n",
       "    }\n",
       "\n",
       "    this.imageObj = new Image();\n",
       "\n",
       "    this.context = undefined;\n",
       "    this.message = undefined;\n",
       "    this.canvas = undefined;\n",
       "    this.rubberband_canvas = undefined;\n",
       "    this.rubberband_context = undefined;\n",
       "    this.format_dropdown = undefined;\n",
       "\n",
       "    this.image_mode = 'full';\n",
       "\n",
       "    this.root = $('<div/>');\n",
       "    this._root_extra_style(this.root)\n",
       "    this.root.attr('style', 'display: inline-block');\n",
       "\n",
       "    $(parent_element).append(this.root);\n",
       "\n",
       "    this._init_header(this);\n",
       "    this._init_canvas(this);\n",
       "    this._init_toolbar(this);\n",
       "\n",
       "    var fig = this;\n",
       "\n",
       "    this.waiting = false;\n",
       "\n",
       "    this.ws.onopen =  function () {\n",
       "            fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
       "            fig.send_message(\"send_image_mode\", {});\n",
       "            if (mpl.ratio != 1) {\n",
       "                fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
       "            }\n",
       "            fig.send_message(\"refresh\", {});\n",
       "        }\n",
       "\n",
       "    this.imageObj.onload = function() {\n",
       "            if (fig.image_mode == 'full') {\n",
       "                // Full images could contain transparency (where diff images\n",
       "                // almost always do), so we need to clear the canvas so that\n",
       "                // there is no ghosting.\n",
       "                fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
       "            }\n",
       "            fig.context.drawImage(fig.imageObj, 0, 0);\n",
       "        };\n",
       "\n",
       "    this.imageObj.onunload = function() {\n",
       "        fig.ws.close();\n",
       "    }\n",
       "\n",
       "    this.ws.onmessage = this._make_on_message_function(this);\n",
       "\n",
       "    this.ondownload = ondownload;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_header = function() {\n",
       "    var titlebar = $(\n",
       "        '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n",
       "        'ui-helper-clearfix\"/>');\n",
       "    var titletext = $(\n",
       "        '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n",
       "        'text-align: center; padding: 3px;\"/>');\n",
       "    titlebar.append(titletext)\n",
       "    this.root.append(titlebar);\n",
       "    this.header = titletext[0];\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
       "\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
       "\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_canvas = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var canvas_div = $('<div/>');\n",
       "\n",
       "    canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
       "\n",
       "    function canvas_keyboard_event(event) {\n",
       "        return fig.key_event(event, event['data']);\n",
       "    }\n",
       "\n",
       "    canvas_div.keydown('key_press', canvas_keyboard_event);\n",
       "    canvas_div.keyup('key_release', canvas_keyboard_event);\n",
       "    this.canvas_div = canvas_div\n",
       "    this._canvas_extra_style(canvas_div)\n",
       "    this.root.append(canvas_div);\n",
       "\n",
       "    var canvas = $('<canvas/>');\n",
       "    canvas.addClass('mpl-canvas');\n",
       "    canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
       "\n",
       "    this.canvas = canvas[0];\n",
       "    this.context = canvas[0].getContext(\"2d\");\n",
       "\n",
       "    var backingStore = this.context.backingStorePixelRatio ||\n",
       "\tthis.context.webkitBackingStorePixelRatio ||\n",
       "\tthis.context.mozBackingStorePixelRatio ||\n",
       "\tthis.context.msBackingStorePixelRatio ||\n",
       "\tthis.context.oBackingStorePixelRatio ||\n",
       "\tthis.context.backingStorePixelRatio || 1;\n",
       "\n",
       "    mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
       "\n",
       "    var rubberband = $('<canvas/>');\n",
       "    rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
       "\n",
       "    var pass_mouse_events = true;\n",
       "\n",
       "    canvas_div.resizable({\n",
       "        start: function(event, ui) {\n",
       "            pass_mouse_events = false;\n",
       "        },\n",
       "        resize: function(event, ui) {\n",
       "            fig.request_resize(ui.size.width, ui.size.height);\n",
       "        },\n",
       "        stop: function(event, ui) {\n",
       "            pass_mouse_events = true;\n",
       "            fig.request_resize(ui.size.width, ui.size.height);\n",
       "        },\n",
       "    });\n",
       "\n",
       "    function mouse_event_fn(event) {\n",
       "        if (pass_mouse_events)\n",
       "            return fig.mouse_event(event, event['data']);\n",
       "    }\n",
       "\n",
       "    rubberband.mousedown('button_press', mouse_event_fn);\n",
       "    rubberband.mouseup('button_release', mouse_event_fn);\n",
       "    // Throttle sequential mouse events to 1 every 20ms.\n",
       "    rubberband.mousemove('motion_notify', mouse_event_fn);\n",
       "\n",
       "    rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
       "    rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
       "\n",
       "    canvas_div.on(\"wheel\", function (event) {\n",
       "        event = event.originalEvent;\n",
       "        event['data'] = 'scroll'\n",
       "        if (event.deltaY < 0) {\n",
       "            event.step = 1;\n",
       "        } else {\n",
       "            event.step = -1;\n",
       "        }\n",
       "        mouse_event_fn(event);\n",
       "    });\n",
       "\n",
       "    canvas_div.append(canvas);\n",
       "    canvas_div.append(rubberband);\n",
       "\n",
       "    this.rubberband = rubberband;\n",
       "    this.rubberband_canvas = rubberband[0];\n",
       "    this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
       "    this.rubberband_context.strokeStyle = \"#000000\";\n",
       "\n",
       "    this._resize_canvas = function(width, height) {\n",
       "        // Keep the size of the canvas, canvas container, and rubber band\n",
       "        // canvas in synch.\n",
       "        canvas_div.css('width', width)\n",
       "        canvas_div.css('height', height)\n",
       "\n",
       "        canvas.attr('width', width * mpl.ratio);\n",
       "        canvas.attr('height', height * mpl.ratio);\n",
       "        canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
       "\n",
       "        rubberband.attr('width', width);\n",
       "        rubberband.attr('height', height);\n",
       "    }\n",
       "\n",
       "    // Set the figure to an initial 600x600px, this will subsequently be updated\n",
       "    // upon first draw.\n",
       "    this._resize_canvas(600, 600);\n",
       "\n",
       "    // Disable right mouse context menu.\n",
       "    $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
       "        return false;\n",
       "    });\n",
       "\n",
       "    function set_focus () {\n",
       "        canvas.focus();\n",
       "        canvas_div.focus();\n",
       "    }\n",
       "\n",
       "    window.setTimeout(set_focus, 100);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_toolbar = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var nav_element = $('<div/>');\n",
       "    nav_element.attr('style', 'width: 100%');\n",
       "    this.root.append(nav_element);\n",
       "\n",
       "    // Define a callback function for later on.\n",
       "    function toolbar_event(event) {\n",
       "        return fig.toolbar_button_onclick(event['data']);\n",
       "    }\n",
       "    function toolbar_mouse_event(event) {\n",
       "        return fig.toolbar_button_onmouseover(event['data']);\n",
       "    }\n",
       "\n",
       "    for(var toolbar_ind in mpl.toolbar_items) {\n",
       "        var name = mpl.toolbar_items[toolbar_ind][0];\n",
       "        var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
       "        var image = mpl.toolbar_items[toolbar_ind][2];\n",
       "        var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
       "\n",
       "        if (!name) {\n",
       "            // put a spacer in here.\n",
       "            continue;\n",
       "        }\n",
       "        var button = $('<button/>');\n",
       "        button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
       "                        'ui-button-icon-only');\n",
       "        button.attr('role', 'button');\n",
       "        button.attr('aria-disabled', 'false');\n",
       "        button.click(method_name, toolbar_event);\n",
       "        button.mouseover(tooltip, toolbar_mouse_event);\n",
       "\n",
       "        var icon_img = $('<span/>');\n",
       "        icon_img.addClass('ui-button-icon-primary ui-icon');\n",
       "        icon_img.addClass(image);\n",
       "        icon_img.addClass('ui-corner-all');\n",
       "\n",
       "        var tooltip_span = $('<span/>');\n",
       "        tooltip_span.addClass('ui-button-text');\n",
       "        tooltip_span.html(tooltip);\n",
       "\n",
       "        button.append(icon_img);\n",
       "        button.append(tooltip_span);\n",
       "\n",
       "        nav_element.append(button);\n",
       "    }\n",
       "\n",
       "    var fmt_picker_span = $('<span/>');\n",
       "\n",
       "    var fmt_picker = $('<select/>');\n",
       "    fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
       "    fmt_picker_span.append(fmt_picker);\n",
       "    nav_element.append(fmt_picker_span);\n",
       "    this.format_dropdown = fmt_picker[0];\n",
       "\n",
       "    for (var ind in mpl.extensions) {\n",
       "        var fmt = mpl.extensions[ind];\n",
       "        var option = $(\n",
       "            '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n",
       "        fmt_picker.append(option);\n",
       "    }\n",
       "\n",
       "    // Add hover states to the ui-buttons\n",
       "    $( \".ui-button\" ).hover(\n",
       "        function() { $(this).addClass(\"ui-state-hover\");},\n",
       "        function() { $(this).removeClass(\"ui-state-hover\");}\n",
       "    );\n",
       "\n",
       "    var status_bar = $('<span class=\"mpl-message\"/>');\n",
       "    nav_element.append(status_bar);\n",
       "    this.message = status_bar[0];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
       "    // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
       "    // which will in turn request a refresh of the image.\n",
       "    this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.send_message = function(type, properties) {\n",
       "    properties['type'] = type;\n",
       "    properties['figure_id'] = this.id;\n",
       "    this.ws.send(JSON.stringify(properties));\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.send_draw_message = function() {\n",
       "    if (!this.waiting) {\n",
       "        this.waiting = true;\n",
       "        this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
       "    var format_dropdown = fig.format_dropdown;\n",
       "    var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
       "    fig.ondownload(fig, format);\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
       "    var size = msg['size'];\n",
       "    if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
       "        fig._resize_canvas(size[0], size[1]);\n",
       "        fig.send_message(\"refresh\", {});\n",
       "    };\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
       "    var x0 = msg['x0'] / mpl.ratio;\n",
       "    var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
       "    var x1 = msg['x1'] / mpl.ratio;\n",
       "    var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
       "    x0 = Math.floor(x0) + 0.5;\n",
       "    y0 = Math.floor(y0) + 0.5;\n",
       "    x1 = Math.floor(x1) + 0.5;\n",
       "    y1 = Math.floor(y1) + 0.5;\n",
       "    var min_x = Math.min(x0, x1);\n",
       "    var min_y = Math.min(y0, y1);\n",
       "    var width = Math.abs(x1 - x0);\n",
       "    var height = Math.abs(y1 - y0);\n",
       "\n",
       "    fig.rubberband_context.clearRect(\n",
       "        0, 0, fig.canvas.width, fig.canvas.height);\n",
       "\n",
       "    fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
       "    // Updates the figure title.\n",
       "    fig.header.textContent = msg['label'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
       "    var cursor = msg['cursor'];\n",
       "    switch(cursor)\n",
       "    {\n",
       "    case 0:\n",
       "        cursor = 'pointer';\n",
       "        break;\n",
       "    case 1:\n",
       "        cursor = 'default';\n",
       "        break;\n",
       "    case 2:\n",
       "        cursor = 'crosshair';\n",
       "        break;\n",
       "    case 3:\n",
       "        cursor = 'move';\n",
       "        break;\n",
       "    }\n",
       "    fig.rubberband_canvas.style.cursor = cursor;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_message = function(fig, msg) {\n",
       "    fig.message.textContent = msg['message'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
       "    // Request the server to send over a new figure.\n",
       "    fig.send_draw_message();\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
       "    fig.image_mode = msg['mode'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.updated_canvas_event = function() {\n",
       "    // Called whenever the canvas gets updated.\n",
       "    this.send_message(\"ack\", {});\n",
       "}\n",
       "\n",
       "// A function to construct a web socket function for onmessage handling.\n",
       "// Called in the figure constructor.\n",
       "mpl.figure.prototype._make_on_message_function = function(fig) {\n",
       "    return function socket_on_message(evt) {\n",
       "        if (evt.data instanceof Blob) {\n",
       "            /* FIXME: We get \"Resource interpreted as Image but\n",
       "             * transferred with MIME type text/plain:\" errors on\n",
       "             * Chrome.  But how to set the MIME type?  It doesn't seem\n",
       "             * to be part of the websocket stream */\n",
       "            evt.data.type = \"image/png\";\n",
       "\n",
       "            /* Free the memory for the previous frames */\n",
       "            if (fig.imageObj.src) {\n",
       "                (window.URL || window.webkitURL).revokeObjectURL(\n",
       "                    fig.imageObj.src);\n",
       "            }\n",
       "\n",
       "            fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
       "                evt.data);\n",
       "            fig.updated_canvas_event();\n",
       "            fig.waiting = false;\n",
       "            return;\n",
       "        }\n",
       "        else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
       "            fig.imageObj.src = evt.data;\n",
       "            fig.updated_canvas_event();\n",
       "            fig.waiting = false;\n",
       "            return;\n",
       "        }\n",
       "\n",
       "        var msg = JSON.parse(evt.data);\n",
       "        var msg_type = msg['type'];\n",
       "\n",
       "        // Call the  \"handle_{type}\" callback, which takes\n",
       "        // the figure and JSON message as its only arguments.\n",
       "        try {\n",
       "            var callback = fig[\"handle_\" + msg_type];\n",
       "        } catch (e) {\n",
       "            console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
       "            return;\n",
       "        }\n",
       "\n",
       "        if (callback) {\n",
       "            try {\n",
       "                // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
       "                callback(fig, msg);\n",
       "            } catch (e) {\n",
       "                console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
       "            }\n",
       "        }\n",
       "    };\n",
       "}\n",
       "\n",
       "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
       "mpl.findpos = function(e) {\n",
       "    //this section is from http://www.quirksmode.org/js/events_properties.html\n",
       "    var targ;\n",
       "    if (!e)\n",
       "        e = window.event;\n",
       "    if (e.target)\n",
       "        targ = e.target;\n",
       "    else if (e.srcElement)\n",
       "        targ = e.srcElement;\n",
       "    if (targ.nodeType == 3) // defeat Safari bug\n",
       "        targ = targ.parentNode;\n",
       "\n",
       "    // jQuery normalizes the pageX and pageY\n",
       "    // pageX,Y are the mouse positions relative to the document\n",
       "    // offset() returns the position of the element relative to the document\n",
       "    var x = e.pageX - $(targ).offset().left;\n",
       "    var y = e.pageY - $(targ).offset().top;\n",
       "\n",
       "    return {\"x\": x, \"y\": y};\n",
       "};\n",
       "\n",
       "/*\n",
       " * return a copy of an object with only non-object keys\n",
       " * we need this to avoid circular references\n",
       " * http://stackoverflow.com/a/24161582/3208463\n",
       " */\n",
       "function simpleKeys (original) {\n",
       "  return Object.keys(original).reduce(function (obj, key) {\n",
       "    if (typeof original[key] !== 'object')\n",
       "        obj[key] = original[key]\n",
       "    return obj;\n",
       "  }, {});\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.mouse_event = function(event, name) {\n",
       "    var canvas_pos = mpl.findpos(event)\n",
       "\n",
       "    if (name === 'button_press')\n",
       "    {\n",
       "        this.canvas.focus();\n",
       "        this.canvas_div.focus();\n",
       "    }\n",
       "\n",
       "    var x = canvas_pos.x * mpl.ratio;\n",
       "    var y = canvas_pos.y * mpl.ratio;\n",
       "\n",
       "    this.send_message(name, {x: x, y: y, button: event.button,\n",
       "                             step: event.step,\n",
       "                             guiEvent: simpleKeys(event)});\n",
       "\n",
       "    /* This prevents the web browser from automatically changing to\n",
       "     * the text insertion cursor when the button is pressed.  We want\n",
       "     * to control all of the cursor setting manually through the\n",
       "     * 'cursor' event from matplotlib */\n",
       "    event.preventDefault();\n",
       "    return false;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
       "    // Handle any extra behaviour associated with a key event\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.key_event = function(event, name) {\n",
       "\n",
       "    // Prevent repeat events\n",
       "    if (name == 'key_press')\n",
       "    {\n",
       "        if (event.which === this._key)\n",
       "            return;\n",
       "        else\n",
       "            this._key = event.which;\n",
       "    }\n",
       "    if (name == 'key_release')\n",
       "        this._key = null;\n",
       "\n",
       "    var value = '';\n",
       "    if (event.ctrlKey && event.which != 17)\n",
       "        value += \"ctrl+\";\n",
       "    if (event.altKey && event.which != 18)\n",
       "        value += \"alt+\";\n",
       "    if (event.shiftKey && event.which != 16)\n",
       "        value += \"shift+\";\n",
       "\n",
       "    value += 'k';\n",
       "    value += event.which.toString();\n",
       "\n",
       "    this._key_event_extra(event, name);\n",
       "\n",
       "    this.send_message(name, {key: value,\n",
       "                             guiEvent: simpleKeys(event)});\n",
       "    return false;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
       "    if (name == 'download') {\n",
       "        this.handle_save(this, null);\n",
       "    } else {\n",
       "        this.send_message(\"toolbar_button\", {name: name});\n",
       "    }\n",
       "};\n",
       "\n",
       "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
       "    this.message.textContent = tooltip;\n",
       "};\n",
       "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
       "\n",
       "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n",
       "\n",
       "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
       "    // Create a \"websocket\"-like object which calls the given IPython comm\n",
       "    // object with the appropriate methods. Currently this is a non binary\n",
       "    // socket, so there is still some room for performance tuning.\n",
       "    var ws = {};\n",
       "\n",
       "    ws.close = function() {\n",
       "        comm.close()\n",
       "    };\n",
       "    ws.send = function(m) {\n",
       "        //console.log('sending', m);\n",
       "        comm.send(m);\n",
       "    };\n",
       "    // Register the callback with on_msg.\n",
       "    comm.on_msg(function(msg) {\n",
       "        //console.log('receiving', msg['content']['data'], msg);\n",
       "        // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
       "        ws.onmessage(msg['content']['data'])\n",
       "    });\n",
       "    return ws;\n",
       "}\n",
       "\n",
       "mpl.mpl_figure_comm = function(comm, msg) {\n",
       "    // This is the function which gets called when the mpl process\n",
       "    // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
       "\n",
       "    var id = msg.content.data.id;\n",
       "    // Get hold of the div created by the display call when the Comm\n",
       "    // socket was opened in Python.\n",
       "    var element = $(\"#\" + id);\n",
       "    var ws_proxy = comm_websocket_adapter(comm)\n",
       "\n",
       "    function ondownload(figure, format) {\n",
       "        window.open(figure.imageObj.src);\n",
       "    }\n",
       "\n",
       "    var fig = new mpl.figure(id, ws_proxy,\n",
       "                           ondownload,\n",
       "                           element.get(0));\n",
       "\n",
       "    // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
       "    // web socket which is closed, not our websocket->open comm proxy.\n",
       "    ws_proxy.onopen();\n",
       "\n",
       "    fig.parent_element = element.get(0);\n",
       "    fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n",
       "    if (!fig.cell_info) {\n",
       "        console.error(\"Failed to find cell for figure\", id, fig);\n",
       "        return;\n",
       "    }\n",
       "\n",
       "    var output_index = fig.cell_info[2]\n",
       "    var cell = fig.cell_info[0];\n",
       "\n",
       "};\n",
       "\n",
       "mpl.figure.prototype.handle_close = function(fig, msg) {\n",
       "    var width = fig.canvas.width/mpl.ratio\n",
       "    fig.root.unbind('remove')\n",
       "\n",
       "    // Update the output cell to use the data from the current canvas.\n",
       "    fig.push_to_output();\n",
       "    var dataURL = fig.canvas.toDataURL();\n",
       "    // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
       "    // the notebook keyboard shortcuts fail.\n",
       "    IPython.keyboard_manager.enable()\n",
       "    $(fig.parent_element).html('<img src=\"' + dataURL + '\" width=\"' + width + '\">');\n",
       "    fig.close_ws(fig, msg);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.close_ws = function(fig, msg){\n",
       "    fig.send_message('closing', msg);\n",
       "    // fig.ws.close()\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
       "    // Turn the data on the canvas into data in the output cell.\n",
       "    var width = this.canvas.width/mpl.ratio\n",
       "    var dataURL = this.canvas.toDataURL();\n",
       "    this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\" width=\"' + width + '\">';\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.updated_canvas_event = function() {\n",
       "    // Tell IPython that the notebook contents must change.\n",
       "    IPython.notebook.set_dirty(true);\n",
       "    this.send_message(\"ack\", {});\n",
       "    var fig = this;\n",
       "    // Wait a second, then push the new image to the DOM so\n",
       "    // that it is saved nicely (might be nice to debounce this).\n",
       "    setTimeout(function () { fig.push_to_output() }, 1000);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_toolbar = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var nav_element = $('<div/>');\n",
       "    nav_element.attr('style', 'width: 100%');\n",
       "    this.root.append(nav_element);\n",
       "\n",
       "    // Define a callback function for later on.\n",
       "    function toolbar_event(event) {\n",
       "        return fig.toolbar_button_onclick(event['data']);\n",
       "    }\n",
       "    function toolbar_mouse_event(event) {\n",
       "        return fig.toolbar_button_onmouseover(event['data']);\n",
       "    }\n",
       "\n",
       "    for(var toolbar_ind in mpl.toolbar_items){\n",
       "        var name = mpl.toolbar_items[toolbar_ind][0];\n",
       "        var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
       "        var image = mpl.toolbar_items[toolbar_ind][2];\n",
       "        var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
       "\n",
       "        if (!name) { continue; };\n",
       "\n",
       "        var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n",
       "        button.click(method_name, toolbar_event);\n",
       "        button.mouseover(tooltip, toolbar_mouse_event);\n",
       "        nav_element.append(button);\n",
       "    }\n",
       "\n",
       "    // Add the status bar.\n",
       "    var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n",
       "    nav_element.append(status_bar);\n",
       "    this.message = status_bar[0];\n",
       "\n",
       "    // Add the close button to the window.\n",
       "    var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n",
       "    var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n",
       "    button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
       "    button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
       "    buttongrp.append(button);\n",
       "    var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
       "    titlebar.prepend(buttongrp);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._root_extra_style = function(el){\n",
       "    var fig = this\n",
       "    el.on(\"remove\", function(){\n",
       "\tfig.close_ws(fig, {});\n",
       "    });\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._canvas_extra_style = function(el){\n",
       "    // this is important to make the div 'focusable\n",
       "    el.attr('tabindex', 0)\n",
       "    // reach out to IPython and tell the keyboard manager to turn it's self\n",
       "    // off when our div gets focus\n",
       "\n",
       "    // location in version 3\n",
       "    if (IPython.notebook.keyboard_manager) {\n",
       "        IPython.notebook.keyboard_manager.register_events(el);\n",
       "    }\n",
       "    else {\n",
       "        // location in version 2\n",
       "        IPython.keyboard_manager.register_events(el);\n",
       "    }\n",
       "\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
       "    var manager = IPython.notebook.keyboard_manager;\n",
       "    if (!manager)\n",
       "        manager = IPython.keyboard_manager;\n",
       "\n",
       "    // Check for shift+enter\n",
       "    if (event.shiftKey && event.which == 13) {\n",
       "        this.canvas_div.blur();\n",
       "        event.shiftKey = false;\n",
       "        // Send a \"J\" for go to next cell\n",
       "        event.which = 74;\n",
       "        event.keyCode = 74;\n",
       "        manager.command_mode();\n",
       "        manager.handle_keydown(event);\n",
       "    }\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
       "    fig.ondownload(fig, null);\n",
       "}\n",
       "\n",
       "\n",
       "mpl.find_output_cell = function(html_output) {\n",
       "    // Return the cell and output element which can be found *uniquely* in the notebook.\n",
       "    // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
       "    // IPython event is triggered only after the cells have been serialised, which for\n",
       "    // our purposes (turning an active figure into a static one), is too late.\n",
       "    var cells = IPython.notebook.get_cells();\n",
       "    var ncells = cells.length;\n",
       "    for (var i=0; i<ncells; i++) {\n",
       "        var cell = cells[i];\n",
       "        if (cell.cell_type === 'code'){\n",
       "            for (var j=0; j<cell.output_area.outputs.length; j++) {\n",
       "                var data = cell.output_area.outputs[j];\n",
       "                if (data.data) {\n",
       "                    // IPython >= 3 moved mimebundle to data attribute of output\n",
       "                    data = data.data;\n",
       "                }\n",
       "                if (data['text/html'] == html_output) {\n",
       "                    return [cell, data, j];\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "}\n",
       "\n",
       "// Register the function which deals with the matplotlib target/channel.\n",
       "// The kernel may be null if the page has been refreshed.\n",
       "if (IPython.notebook.kernel != null) {\n",
       "    IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
       "}\n"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<img src=\"\" width=\"640\">"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df_whole[['K','D','J']].plot()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1）谁是快线？谁是慢线？\n",
    "%K为快线，%D为慢线,\n",
    "D线滞后，某种程度上是向右平移（不是标准的平移，而是滞后就是向右平移）\n",
    "\n",
    "2）那么什么是第三根%J线？\n",
    "\n",
    "K线（快速确认线）——也就是说可以快速判断方向（数值范围：10-90，如果大于90的情况下，超买，小于10为超卖）\n",
    "\n",
    "D线（慢速主干线）——也就是说可以判断趋势方向（数值范围：20-80，如果大于80的情况下，超买，小于20为超卖）\n",
    "\n",
    "J线（方向敏感线）——也就是我们可以通过J线判断短期头部和底部（数值范围：0-100，如果长时间（5天）大于100的情况，可能会形成短期头部，长时间小于0，可能会形成短期底部）\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$K_t = \\frac{2}{3}*K_{t-1}+\\frac{1}{3}*RSV_t$ <br>\n",
    "$D_t = \\frac{2}{3}*D_{t-1}+\\frac{1}{3}*K_t$ <br>\n",
    "$J_t = 3* K_{t}-2*D_{t} $"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "/* Put everything inside the global mpl namespace */\n",
       "window.mpl = {};\n",
       "\n",
       "\n",
       "mpl.get_websocket_type = function() {\n",
       "    if (typeof(WebSocket) !== 'undefined') {\n",
       "        return WebSocket;\n",
       "    } else if (typeof(MozWebSocket) !== 'undefined') {\n",
       "        return MozWebSocket;\n",
       "    } else {\n",
       "        alert('Your browser does not have WebSocket support. ' +\n",
       "              'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
       "              'Firefox 4 and 5 are also supported but you ' +\n",
       "              'have to enable WebSockets in about:config.');\n",
       "    };\n",
       "}\n",
       "\n",
       "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
       "    this.id = figure_id;\n",
       "\n",
       "    this.ws = websocket;\n",
       "\n",
       "    this.supports_binary = (this.ws.binaryType != undefined);\n",
       "\n",
       "    if (!this.supports_binary) {\n",
       "        var warnings = document.getElementById(\"mpl-warnings\");\n",
       "        if (warnings) {\n",
       "            warnings.style.display = 'block';\n",
       "            warnings.textContent = (\n",
       "                \"This browser does not support binary websocket messages. \" +\n",
       "                    \"Performance may be slow.\");\n",
       "        }\n",
       "    }\n",
       "\n",
       "    this.imageObj = new Image();\n",
       "\n",
       "    this.context = undefined;\n",
       "    this.message = undefined;\n",
       "    this.canvas = undefined;\n",
       "    this.rubberband_canvas = undefined;\n",
       "    this.rubberband_context = undefined;\n",
       "    this.format_dropdown = undefined;\n",
       "\n",
       "    this.image_mode = 'full';\n",
       "\n",
       "    this.root = $('<div/>');\n",
       "    this._root_extra_style(this.root)\n",
       "    this.root.attr('style', 'display: inline-block');\n",
       "\n",
       "    $(parent_element).append(this.root);\n",
       "\n",
       "    this._init_header(this);\n",
       "    this._init_canvas(this);\n",
       "    this._init_toolbar(this);\n",
       "\n",
       "    var fig = this;\n",
       "\n",
       "    this.waiting = false;\n",
       "\n",
       "    this.ws.onopen =  function () {\n",
       "            fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
       "            fig.send_message(\"send_image_mode\", {});\n",
       "            if (mpl.ratio != 1) {\n",
       "                fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
       "            }\n",
       "            fig.send_message(\"refresh\", {});\n",
       "        }\n",
       "\n",
       "    this.imageObj.onload = function() {\n",
       "            if (fig.image_mode == 'full') {\n",
       "                // Full images could contain transparency (where diff images\n",
       "                // almost always do), so we need to clear the canvas so that\n",
       "                // there is no ghosting.\n",
       "                fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
       "            }\n",
       "            fig.context.drawImage(fig.imageObj, 0, 0);\n",
       "        };\n",
       "\n",
       "    this.imageObj.onunload = function() {\n",
       "        fig.ws.close();\n",
       "    }\n",
       "\n",
       "    this.ws.onmessage = this._make_on_message_function(this);\n",
       "\n",
       "    this.ondownload = ondownload;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_header = function() {\n",
       "    var titlebar = $(\n",
       "        '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n",
       "        'ui-helper-clearfix\"/>');\n",
       "    var titletext = $(\n",
       "        '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n",
       "        'text-align: center; padding: 3px;\"/>');\n",
       "    titlebar.append(titletext)\n",
       "    this.root.append(titlebar);\n",
       "    this.header = titletext[0];\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
       "\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
       "\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_canvas = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var canvas_div = $('<div/>');\n",
       "\n",
       "    canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
       "\n",
       "    function canvas_keyboard_event(event) {\n",
       "        return fig.key_event(event, event['data']);\n",
       "    }\n",
       "\n",
       "    canvas_div.keydown('key_press', canvas_keyboard_event);\n",
       "    canvas_div.keyup('key_release', canvas_keyboard_event);\n",
       "    this.canvas_div = canvas_div\n",
       "    this._canvas_extra_style(canvas_div)\n",
       "    this.root.append(canvas_div);\n",
       "\n",
       "    var canvas = $('<canvas/>');\n",
       "    canvas.addClass('mpl-canvas');\n",
       "    canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
       "\n",
       "    this.canvas = canvas[0];\n",
       "    this.context = canvas[0].getContext(\"2d\");\n",
       "\n",
       "    var backingStore = this.context.backingStorePixelRatio ||\n",
       "\tthis.context.webkitBackingStorePixelRatio ||\n",
       "\tthis.context.mozBackingStorePixelRatio ||\n",
       "\tthis.context.msBackingStorePixelRatio ||\n",
       "\tthis.context.oBackingStorePixelRatio ||\n",
       "\tthis.context.backingStorePixelRatio || 1;\n",
       "\n",
       "    mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
       "\n",
       "    var rubberband = $('<canvas/>');\n",
       "    rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
       "\n",
       "    var pass_mouse_events = true;\n",
       "\n",
       "    canvas_div.resizable({\n",
       "        start: function(event, ui) {\n",
       "            pass_mouse_events = false;\n",
       "        },\n",
       "        resize: function(event, ui) {\n",
       "            fig.request_resize(ui.size.width, ui.size.height);\n",
       "        },\n",
       "        stop: function(event, ui) {\n",
       "            pass_mouse_events = true;\n",
       "            fig.request_resize(ui.size.width, ui.size.height);\n",
       "        },\n",
       "    });\n",
       "\n",
       "    function mouse_event_fn(event) {\n",
       "        if (pass_mouse_events)\n",
       "            return fig.mouse_event(event, event['data']);\n",
       "    }\n",
       "\n",
       "    rubberband.mousedown('button_press', mouse_event_fn);\n",
       "    rubberband.mouseup('button_release', mouse_event_fn);\n",
       "    // Throttle sequential mouse events to 1 every 20ms.\n",
       "    rubberband.mousemove('motion_notify', mouse_event_fn);\n",
       "\n",
       "    rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
       "    rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
       "\n",
       "    canvas_div.on(\"wheel\", function (event) {\n",
       "        event = event.originalEvent;\n",
       "        event['data'] = 'scroll'\n",
       "        if (event.deltaY < 0) {\n",
       "            event.step = 1;\n",
       "        } else {\n",
       "            event.step = -1;\n",
       "        }\n",
       "        mouse_event_fn(event);\n",
       "    });\n",
       "\n",
       "    canvas_div.append(canvas);\n",
       "    canvas_div.append(rubberband);\n",
       "\n",
       "    this.rubberband = rubberband;\n",
       "    this.rubberband_canvas = rubberband[0];\n",
       "    this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
       "    this.rubberband_context.strokeStyle = \"#000000\";\n",
       "\n",
       "    this._resize_canvas = function(width, height) {\n",
       "        // Keep the size of the canvas, canvas container, and rubber band\n",
       "        // canvas in synch.\n",
       "        canvas_div.css('width', width)\n",
       "        canvas_div.css('height', height)\n",
       "\n",
       "        canvas.attr('width', width * mpl.ratio);\n",
       "        canvas.attr('height', height * mpl.ratio);\n",
       "        canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
       "\n",
       "        rubberband.attr('width', width);\n",
       "        rubberband.attr('height', height);\n",
       "    }\n",
       "\n",
       "    // Set the figure to an initial 600x600px, this will subsequently be updated\n",
       "    // upon first draw.\n",
       "    this._resize_canvas(600, 600);\n",
       "\n",
       "    // Disable right mouse context menu.\n",
       "    $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
       "        return false;\n",
       "    });\n",
       "\n",
       "    function set_focus () {\n",
       "        canvas.focus();\n",
       "        canvas_div.focus();\n",
       "    }\n",
       "\n",
       "    window.setTimeout(set_focus, 100);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_toolbar = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var nav_element = $('<div/>');\n",
       "    nav_element.attr('style', 'width: 100%');\n",
       "    this.root.append(nav_element);\n",
       "\n",
       "    // Define a callback function for later on.\n",
       "    function toolbar_event(event) {\n",
       "        return fig.toolbar_button_onclick(event['data']);\n",
       "    }\n",
       "    function toolbar_mouse_event(event) {\n",
       "        return fig.toolbar_button_onmouseover(event['data']);\n",
       "    }\n",
       "\n",
       "    for(var toolbar_ind in mpl.toolbar_items) {\n",
       "        var name = mpl.toolbar_items[toolbar_ind][0];\n",
       "        var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
       "        var image = mpl.toolbar_items[toolbar_ind][2];\n",
       "        var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
       "\n",
       "        if (!name) {\n",
       "            // put a spacer in here.\n",
       "            continue;\n",
       "        }\n",
       "        var button = $('<button/>');\n",
       "        button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
       "                        'ui-button-icon-only');\n",
       "        button.attr('role', 'button');\n",
       "        button.attr('aria-disabled', 'false');\n",
       "        button.click(method_name, toolbar_event);\n",
       "        button.mouseover(tooltip, toolbar_mouse_event);\n",
       "\n",
       "        var icon_img = $('<span/>');\n",
       "        icon_img.addClass('ui-button-icon-primary ui-icon');\n",
       "        icon_img.addClass(image);\n",
       "        icon_img.addClass('ui-corner-all');\n",
       "\n",
       "        var tooltip_span = $('<span/>');\n",
       "        tooltip_span.addClass('ui-button-text');\n",
       "        tooltip_span.html(tooltip);\n",
       "\n",
       "        button.append(icon_img);\n",
       "        button.append(tooltip_span);\n",
       "\n",
       "        nav_element.append(button);\n",
       "    }\n",
       "\n",
       "    var fmt_picker_span = $('<span/>');\n",
       "\n",
       "    var fmt_picker = $('<select/>');\n",
       "    fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
       "    fmt_picker_span.append(fmt_picker);\n",
       "    nav_element.append(fmt_picker_span);\n",
       "    this.format_dropdown = fmt_picker[0];\n",
       "\n",
       "    for (var ind in mpl.extensions) {\n",
       "        var fmt = mpl.extensions[ind];\n",
       "        var option = $(\n",
       "            '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n",
       "        fmt_picker.append(option);\n",
       "    }\n",
       "\n",
       "    // Add hover states to the ui-buttons\n",
       "    $( \".ui-button\" ).hover(\n",
       "        function() { $(this).addClass(\"ui-state-hover\");},\n",
       "        function() { $(this).removeClass(\"ui-state-hover\");}\n",
       "    );\n",
       "\n",
       "    var status_bar = $('<span class=\"mpl-message\"/>');\n",
       "    nav_element.append(status_bar);\n",
       "    this.message = status_bar[0];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
       "    // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
       "    // which will in turn request a refresh of the image.\n",
       "    this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.send_message = function(type, properties) {\n",
       "    properties['type'] = type;\n",
       "    properties['figure_id'] = this.id;\n",
       "    this.ws.send(JSON.stringify(properties));\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.send_draw_message = function() {\n",
       "    if (!this.waiting) {\n",
       "        this.waiting = true;\n",
       "        this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
       "    var format_dropdown = fig.format_dropdown;\n",
       "    var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
       "    fig.ondownload(fig, format);\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
       "    var size = msg['size'];\n",
       "    if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
       "        fig._resize_canvas(size[0], size[1]);\n",
       "        fig.send_message(\"refresh\", {});\n",
       "    };\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
       "    var x0 = msg['x0'] / mpl.ratio;\n",
       "    var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
       "    var x1 = msg['x1'] / mpl.ratio;\n",
       "    var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
       "    x0 = Math.floor(x0) + 0.5;\n",
       "    y0 = Math.floor(y0) + 0.5;\n",
       "    x1 = Math.floor(x1) + 0.5;\n",
       "    y1 = Math.floor(y1) + 0.5;\n",
       "    var min_x = Math.min(x0, x1);\n",
       "    var min_y = Math.min(y0, y1);\n",
       "    var width = Math.abs(x1 - x0);\n",
       "    var height = Math.abs(y1 - y0);\n",
       "\n",
       "    fig.rubberband_context.clearRect(\n",
       "        0, 0, fig.canvas.width, fig.canvas.height);\n",
       "\n",
       "    fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
       "    // Updates the figure title.\n",
       "    fig.header.textContent = msg['label'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
       "    var cursor = msg['cursor'];\n",
       "    switch(cursor)\n",
       "    {\n",
       "    case 0:\n",
       "        cursor = 'pointer';\n",
       "        break;\n",
       "    case 1:\n",
       "        cursor = 'default';\n",
       "        break;\n",
       "    case 2:\n",
       "        cursor = 'crosshair';\n",
       "        break;\n",
       "    case 3:\n",
       "        cursor = 'move';\n",
       "        break;\n",
       "    }\n",
       "    fig.rubberband_canvas.style.cursor = cursor;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_message = function(fig, msg) {\n",
       "    fig.message.textContent = msg['message'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
       "    // Request the server to send over a new figure.\n",
       "    fig.send_draw_message();\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
       "    fig.image_mode = msg['mode'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.updated_canvas_event = function() {\n",
       "    // Called whenever the canvas gets updated.\n",
       "    this.send_message(\"ack\", {});\n",
       "}\n",
       "\n",
       "// A function to construct a web socket function for onmessage handling.\n",
       "// Called in the figure constructor.\n",
       "mpl.figure.prototype._make_on_message_function = function(fig) {\n",
       "    return function socket_on_message(evt) {\n",
       "        if (evt.data instanceof Blob) {\n",
       "            /* FIXME: We get \"Resource interpreted as Image but\n",
       "             * transferred with MIME type text/plain:\" errors on\n",
       "             * Chrome.  But how to set the MIME type?  It doesn't seem\n",
       "             * to be part of the websocket stream */\n",
       "            evt.data.type = \"image/png\";\n",
       "\n",
       "            /* Free the memory for the previous frames */\n",
       "            if (fig.imageObj.src) {\n",
       "                (window.URL || window.webkitURL).revokeObjectURL(\n",
       "                    fig.imageObj.src);\n",
       "            }\n",
       "\n",
       "            fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
       "                evt.data);\n",
       "            fig.updated_canvas_event();\n",
       "            fig.waiting = false;\n",
       "            return;\n",
       "        }\n",
       "        else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
       "            fig.imageObj.src = evt.data;\n",
       "            fig.updated_canvas_event();\n",
       "            fig.waiting = false;\n",
       "            return;\n",
       "        }\n",
       "\n",
       "        var msg = JSON.parse(evt.data);\n",
       "        var msg_type = msg['type'];\n",
       "\n",
       "        // Call the  \"handle_{type}\" callback, which takes\n",
       "        // the figure and JSON message as its only arguments.\n",
       "        try {\n",
       "            var callback = fig[\"handle_\" + msg_type];\n",
       "        } catch (e) {\n",
       "            console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
       "            return;\n",
       "        }\n",
       "\n",
       "        if (callback) {\n",
       "            try {\n",
       "                // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
       "                callback(fig, msg);\n",
       "            } catch (e) {\n",
       "                console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
       "            }\n",
       "        }\n",
       "    };\n",
       "}\n",
       "\n",
       "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
       "mpl.findpos = function(e) {\n",
       "    //this section is from http://www.quirksmode.org/js/events_properties.html\n",
       "    var targ;\n",
       "    if (!e)\n",
       "        e = window.event;\n",
       "    if (e.target)\n",
       "        targ = e.target;\n",
       "    else if (e.srcElement)\n",
       "        targ = e.srcElement;\n",
       "    if (targ.nodeType == 3) // defeat Safari bug\n",
       "        targ = targ.parentNode;\n",
       "\n",
       "    // jQuery normalizes the pageX and pageY\n",
       "    // pageX,Y are the mouse positions relative to the document\n",
       "    // offset() returns the position of the element relative to the document\n",
       "    var x = e.pageX - $(targ).offset().left;\n",
       "    var y = e.pageY - $(targ).offset().top;\n",
       "\n",
       "    return {\"x\": x, \"y\": y};\n",
       "};\n",
       "\n",
       "/*\n",
       " * return a copy of an object with only non-object keys\n",
       " * we need this to avoid circular references\n",
       " * http://stackoverflow.com/a/24161582/3208463\n",
       " */\n",
       "function simpleKeys (original) {\n",
       "  return Object.keys(original).reduce(function (obj, key) {\n",
       "    if (typeof original[key] !== 'object')\n",
       "        obj[key] = original[key]\n",
       "    return obj;\n",
       "  }, {});\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.mouse_event = function(event, name) {\n",
       "    var canvas_pos = mpl.findpos(event)\n",
       "\n",
       "    if (name === 'button_press')\n",
       "    {\n",
       "        this.canvas.focus();\n",
       "        this.canvas_div.focus();\n",
       "    }\n",
       "\n",
       "    var x = canvas_pos.x * mpl.ratio;\n",
       "    var y = canvas_pos.y * mpl.ratio;\n",
       "\n",
       "    this.send_message(name, {x: x, y: y, button: event.button,\n",
       "                             step: event.step,\n",
       "                             guiEvent: simpleKeys(event)});\n",
       "\n",
       "    /* This prevents the web browser from automatically changing to\n",
       "     * the text insertion cursor when the button is pressed.  We want\n",
       "     * to control all of the cursor setting manually through the\n",
       "     * 'cursor' event from matplotlib */\n",
       "    event.preventDefault();\n",
       "    return false;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
       "    // Handle any extra behaviour associated with a key event\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.key_event = function(event, name) {\n",
       "\n",
       "    // Prevent repeat events\n",
       "    if (name == 'key_press')\n",
       "    {\n",
       "        if (event.which === this._key)\n",
       "            return;\n",
       "        else\n",
       "            this._key = event.which;\n",
       "    }\n",
       "    if (name == 'key_release')\n",
       "        this._key = null;\n",
       "\n",
       "    var value = '';\n",
       "    if (event.ctrlKey && event.which != 17)\n",
       "        value += \"ctrl+\";\n",
       "    if (event.altKey && event.which != 18)\n",
       "        value += \"alt+\";\n",
       "    if (event.shiftKey && event.which != 16)\n",
       "        value += \"shift+\";\n",
       "\n",
       "    value += 'k';\n",
       "    value += event.which.toString();\n",
       "\n",
       "    this._key_event_extra(event, name);\n",
       "\n",
       "    this.send_message(name, {key: value,\n",
       "                             guiEvent: simpleKeys(event)});\n",
       "    return false;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
       "    if (name == 'download') {\n",
       "        this.handle_save(this, null);\n",
       "    } else {\n",
       "        this.send_message(\"toolbar_button\", {name: name});\n",
       "    }\n",
       "};\n",
       "\n",
       "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
       "    this.message.textContent = tooltip;\n",
       "};\n",
       "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
       "\n",
       "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n",
       "\n",
       "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
       "    // Create a \"websocket\"-like object which calls the given IPython comm\n",
       "    // object with the appropriate methods. Currently this is a non binary\n",
       "    // socket, so there is still some room for performance tuning.\n",
       "    var ws = {};\n",
       "\n",
       "    ws.close = function() {\n",
       "        comm.close()\n",
       "    };\n",
       "    ws.send = function(m) {\n",
       "        //console.log('sending', m);\n",
       "        comm.send(m);\n",
       "    };\n",
       "    // Register the callback with on_msg.\n",
       "    comm.on_msg(function(msg) {\n",
       "        //console.log('receiving', msg['content']['data'], msg);\n",
       "        // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
       "        ws.onmessage(msg['content']['data'])\n",
       "    });\n",
       "    return ws;\n",
       "}\n",
       "\n",
       "mpl.mpl_figure_comm = function(comm, msg) {\n",
       "    // This is the function which gets called when the mpl process\n",
       "    // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
       "\n",
       "    var id = msg.content.data.id;\n",
       "    // Get hold of the div created by the display call when the Comm\n",
       "    // socket was opened in Python.\n",
       "    var element = $(\"#\" + id);\n",
       "    var ws_proxy = comm_websocket_adapter(comm)\n",
       "\n",
       "    function ondownload(figure, format) {\n",
       "        window.open(figure.imageObj.src);\n",
       "    }\n",
       "\n",
       "    var fig = new mpl.figure(id, ws_proxy,\n",
       "                           ondownload,\n",
       "                           element.get(0));\n",
       "\n",
       "    // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
       "    // web socket which is closed, not our websocket->open comm proxy.\n",
       "    ws_proxy.onopen();\n",
       "\n",
       "    fig.parent_element = element.get(0);\n",
       "    fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n",
       "    if (!fig.cell_info) {\n",
       "        console.error(\"Failed to find cell for figure\", id, fig);\n",
       "        return;\n",
       "    }\n",
       "\n",
       "    var output_index = fig.cell_info[2]\n",
       "    var cell = fig.cell_info[0];\n",
       "\n",
       "};\n",
       "\n",
       "mpl.figure.prototype.handle_close = function(fig, msg) {\n",
       "    var width = fig.canvas.width/mpl.ratio\n",
       "    fig.root.unbind('remove')\n",
       "\n",
       "    // Update the output cell to use the data from the current canvas.\n",
       "    fig.push_to_output();\n",
       "    var dataURL = fig.canvas.toDataURL();\n",
       "    // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
       "    // the notebook keyboard shortcuts fail.\n",
       "    IPython.keyboard_manager.enable()\n",
       "    $(fig.parent_element).html('<img src=\"' + dataURL + '\" width=\"' + width + '\">');\n",
       "    fig.close_ws(fig, msg);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.close_ws = function(fig, msg){\n",
       "    fig.send_message('closing', msg);\n",
       "    // fig.ws.close()\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
       "    // Turn the data on the canvas into data in the output cell.\n",
       "    var width = this.canvas.width/mpl.ratio\n",
       "    var dataURL = this.canvas.toDataURL();\n",
       "    this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\" width=\"' + width + '\">';\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.updated_canvas_event = function() {\n",
       "    // Tell IPython that the notebook contents must change.\n",
       "    IPython.notebook.set_dirty(true);\n",
       "    this.send_message(\"ack\", {});\n",
       "    var fig = this;\n",
       "    // Wait a second, then push the new image to the DOM so\n",
       "    // that it is saved nicely (might be nice to debounce this).\n",
       "    setTimeout(function () { fig.push_to_output() }, 1000);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_toolbar = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var nav_element = $('<div/>');\n",
       "    nav_element.attr('style', 'width: 100%');\n",
       "    this.root.append(nav_element);\n",
       "\n",
       "    // Define a callback function for later on.\n",
       "    function toolbar_event(event) {\n",
       "        return fig.toolbar_button_onclick(event['data']);\n",
       "    }\n",
       "    function toolbar_mouse_event(event) {\n",
       "        return fig.toolbar_button_onmouseover(event['data']);\n",
       "    }\n",
       "\n",
       "    for(var toolbar_ind in mpl.toolbar_items){\n",
       "        var name = mpl.toolbar_items[toolbar_ind][0];\n",
       "        var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
       "        var image = mpl.toolbar_items[toolbar_ind][2];\n",
       "        var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
       "\n",
       "        if (!name) { continue; };\n",
       "\n",
       "        var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n",
       "        button.click(method_name, toolbar_event);\n",
       "        button.mouseover(tooltip, toolbar_mouse_event);\n",
       "        nav_element.append(button);\n",
       "    }\n",
       "\n",
       "    // Add the status bar.\n",
       "    var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n",
       "    nav_element.append(status_bar);\n",
       "    this.message = status_bar[0];\n",
       "\n",
       "    // Add the close button to the window.\n",
       "    var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n",
       "    var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n",
       "    button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
       "    button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
       "    buttongrp.append(button);\n",
       "    var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
       "    titlebar.prepend(buttongrp);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._root_extra_style = function(el){\n",
       "    var fig = this\n",
       "    el.on(\"remove\", function(){\n",
       "\tfig.close_ws(fig, {});\n",
       "    });\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._canvas_extra_style = function(el){\n",
       "    // this is important to make the div 'focusable\n",
       "    el.attr('tabindex', 0)\n",
       "    // reach out to IPython and tell the keyboard manager to turn it's self\n",
       "    // off when our div gets focus\n",
       "\n",
       "    // location in version 3\n",
       "    if (IPython.notebook.keyboard_manager) {\n",
       "        IPython.notebook.keyboard_manager.register_events(el);\n",
       "    }\n",
       "    else {\n",
       "        // location in version 2\n",
       "        IPython.keyboard_manager.register_events(el);\n",
       "    }\n",
       "\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
       "    var manager = IPython.notebook.keyboard_manager;\n",
       "    if (!manager)\n",
       "        manager = IPython.keyboard_manager;\n",
       "\n",
       "    // Check for shift+enter\n",
       "    if (event.shiftKey && event.which == 13) {\n",
       "        this.canvas_div.blur();\n",
       "        event.shiftKey = false;\n",
       "        // Send a \"J\" for go to next cell\n",
       "        event.which = 74;\n",
       "        event.keyCode = 74;\n",
       "        manager.command_mode();\n",
       "        manager.handle_keydown(event);\n",
       "    }\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
       "    fig.ondownload(fig, null);\n",
       "}\n",
       "\n",
       "\n",
       "mpl.find_output_cell = function(html_output) {\n",
       "    // Return the cell and output element which can be found *uniquely* in the notebook.\n",
       "    // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
       "    // IPython event is triggered only after the cells have been serialised, which for\n",
       "    // our purposes (turning an active figure into a static one), is too late.\n",
       "    var cells = IPython.notebook.get_cells();\n",
       "    var ncells = cells.length;\n",
       "    for (var i=0; i<ncells; i++) {\n",
       "        var cell = cells[i];\n",
       "        if (cell.cell_type === 'code'){\n",
       "            for (var j=0; j<cell.output_area.outputs.length; j++) {\n",
       "                var data = cell.output_area.outputs[j];\n",
       "                if (data.data) {\n",
       "                    // IPython >= 3 moved mimebundle to data attribute of output\n",
       "                    data = data.data;\n",
       "                }\n",
       "                if (data['text/html'] == html_output) {\n",
       "                    return [cell, data, j];\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "}\n",
       "\n",
       "// Register the function which deals with the matplotlib target/channel.\n",
       "// The kernel may be null if the page has been refreshed.\n",
       "if (IPython.notebook.kernel != null) {\n",
       "    IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
       "}\n"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<img src=\"\" width=\"640\">"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df_whole[['K','D','J']].tail(60).plot()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "/* Put everything inside the global mpl namespace */\n",
       "window.mpl = {};\n",
       "\n",
       "\n",
       "mpl.get_websocket_type = function() {\n",
       "    if (typeof(WebSocket) !== 'undefined') {\n",
       "        return WebSocket;\n",
       "    } else if (typeof(MozWebSocket) !== 'undefined') {\n",
       "        return MozWebSocket;\n",
       "    } else {\n",
       "        alert('Your browser does not have WebSocket support. ' +\n",
       "              'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
       "              'Firefox 4 and 5 are also supported but you ' +\n",
       "              'have to enable WebSockets in about:config.');\n",
       "    };\n",
       "}\n",
       "\n",
       "mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
       "    this.id = figure_id;\n",
       "\n",
       "    this.ws = websocket;\n",
       "\n",
       "    this.supports_binary = (this.ws.binaryType != undefined);\n",
       "\n",
       "    if (!this.supports_binary) {\n",
       "        var warnings = document.getElementById(\"mpl-warnings\");\n",
       "        if (warnings) {\n",
       "            warnings.style.display = 'block';\n",
       "            warnings.textContent = (\n",
       "                \"This browser does not support binary websocket messages. \" +\n",
       "                    \"Performance may be slow.\");\n",
       "        }\n",
       "    }\n",
       "\n",
       "    this.imageObj = new Image();\n",
       "\n",
       "    this.context = undefined;\n",
       "    this.message = undefined;\n",
       "    this.canvas = undefined;\n",
       "    this.rubberband_canvas = undefined;\n",
       "    this.rubberband_context = undefined;\n",
       "    this.format_dropdown = undefined;\n",
       "\n",
       "    this.image_mode = 'full';\n",
       "\n",
       "    this.root = $('<div/>');\n",
       "    this._root_extra_style(this.root)\n",
       "    this.root.attr('style', 'display: inline-block');\n",
       "\n",
       "    $(parent_element).append(this.root);\n",
       "\n",
       "    this._init_header(this);\n",
       "    this._init_canvas(this);\n",
       "    this._init_toolbar(this);\n",
       "\n",
       "    var fig = this;\n",
       "\n",
       "    this.waiting = false;\n",
       "\n",
       "    this.ws.onopen =  function () {\n",
       "            fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
       "            fig.send_message(\"send_image_mode\", {});\n",
       "            if (mpl.ratio != 1) {\n",
       "                fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
       "            }\n",
       "            fig.send_message(\"refresh\", {});\n",
       "        }\n",
       "\n",
       "    this.imageObj.onload = function() {\n",
       "            if (fig.image_mode == 'full') {\n",
       "                // Full images could contain transparency (where diff images\n",
       "                // almost always do), so we need to clear the canvas so that\n",
       "                // there is no ghosting.\n",
       "                fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
       "            }\n",
       "            fig.context.drawImage(fig.imageObj, 0, 0);\n",
       "        };\n",
       "\n",
       "    this.imageObj.onunload = function() {\n",
       "        fig.ws.close();\n",
       "    }\n",
       "\n",
       "    this.ws.onmessage = this._make_on_message_function(this);\n",
       "\n",
       "    this.ondownload = ondownload;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_header = function() {\n",
       "    var titlebar = $(\n",
       "        '<div class=\"ui-dialog-titlebar ui-widget-header ui-corner-all ' +\n",
       "        'ui-helper-clearfix\"/>');\n",
       "    var titletext = $(\n",
       "        '<div class=\"ui-dialog-title\" style=\"width: 100%; ' +\n",
       "        'text-align: center; padding: 3px;\"/>');\n",
       "    titlebar.append(titletext)\n",
       "    this.root.append(titlebar);\n",
       "    this.header = titletext[0];\n",
       "}\n",
       "\n",
       "\n",
       "\n",
       "mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
       "\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
       "\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_canvas = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var canvas_div = $('<div/>');\n",
       "\n",
       "    canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
       "\n",
       "    function canvas_keyboard_event(event) {\n",
       "        return fig.key_event(event, event['data']);\n",
       "    }\n",
       "\n",
       "    canvas_div.keydown('key_press', canvas_keyboard_event);\n",
       "    canvas_div.keyup('key_release', canvas_keyboard_event);\n",
       "    this.canvas_div = canvas_div\n",
       "    this._canvas_extra_style(canvas_div)\n",
       "    this.root.append(canvas_div);\n",
       "\n",
       "    var canvas = $('<canvas/>');\n",
       "    canvas.addClass('mpl-canvas');\n",
       "    canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
       "\n",
       "    this.canvas = canvas[0];\n",
       "    this.context = canvas[0].getContext(\"2d\");\n",
       "\n",
       "    var backingStore = this.context.backingStorePixelRatio ||\n",
       "\tthis.context.webkitBackingStorePixelRatio ||\n",
       "\tthis.context.mozBackingStorePixelRatio ||\n",
       "\tthis.context.msBackingStorePixelRatio ||\n",
       "\tthis.context.oBackingStorePixelRatio ||\n",
       "\tthis.context.backingStorePixelRatio || 1;\n",
       "\n",
       "    mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
       "\n",
       "    var rubberband = $('<canvas/>');\n",
       "    rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
       "\n",
       "    var pass_mouse_events = true;\n",
       "\n",
       "    canvas_div.resizable({\n",
       "        start: function(event, ui) {\n",
       "            pass_mouse_events = false;\n",
       "        },\n",
       "        resize: function(event, ui) {\n",
       "            fig.request_resize(ui.size.width, ui.size.height);\n",
       "        },\n",
       "        stop: function(event, ui) {\n",
       "            pass_mouse_events = true;\n",
       "            fig.request_resize(ui.size.width, ui.size.height);\n",
       "        },\n",
       "    });\n",
       "\n",
       "    function mouse_event_fn(event) {\n",
       "        if (pass_mouse_events)\n",
       "            return fig.mouse_event(event, event['data']);\n",
       "    }\n",
       "\n",
       "    rubberband.mousedown('button_press', mouse_event_fn);\n",
       "    rubberband.mouseup('button_release', mouse_event_fn);\n",
       "    // Throttle sequential mouse events to 1 every 20ms.\n",
       "    rubberband.mousemove('motion_notify', mouse_event_fn);\n",
       "\n",
       "    rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
       "    rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
       "\n",
       "    canvas_div.on(\"wheel\", function (event) {\n",
       "        event = event.originalEvent;\n",
       "        event['data'] = 'scroll'\n",
       "        if (event.deltaY < 0) {\n",
       "            event.step = 1;\n",
       "        } else {\n",
       "            event.step = -1;\n",
       "        }\n",
       "        mouse_event_fn(event);\n",
       "    });\n",
       "\n",
       "    canvas_div.append(canvas);\n",
       "    canvas_div.append(rubberband);\n",
       "\n",
       "    this.rubberband = rubberband;\n",
       "    this.rubberband_canvas = rubberband[0];\n",
       "    this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
       "    this.rubberband_context.strokeStyle = \"#000000\";\n",
       "\n",
       "    this._resize_canvas = function(width, height) {\n",
       "        // Keep the size of the canvas, canvas container, and rubber band\n",
       "        // canvas in synch.\n",
       "        canvas_div.css('width', width)\n",
       "        canvas_div.css('height', height)\n",
       "\n",
       "        canvas.attr('width', width * mpl.ratio);\n",
       "        canvas.attr('height', height * mpl.ratio);\n",
       "        canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
       "\n",
       "        rubberband.attr('width', width);\n",
       "        rubberband.attr('height', height);\n",
       "    }\n",
       "\n",
       "    // Set the figure to an initial 600x600px, this will subsequently be updated\n",
       "    // upon first draw.\n",
       "    this._resize_canvas(600, 600);\n",
       "\n",
       "    // Disable right mouse context menu.\n",
       "    $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
       "        return false;\n",
       "    });\n",
       "\n",
       "    function set_focus () {\n",
       "        canvas.focus();\n",
       "        canvas_div.focus();\n",
       "    }\n",
       "\n",
       "    window.setTimeout(set_focus, 100);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_toolbar = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var nav_element = $('<div/>');\n",
       "    nav_element.attr('style', 'width: 100%');\n",
       "    this.root.append(nav_element);\n",
       "\n",
       "    // Define a callback function for later on.\n",
       "    function toolbar_event(event) {\n",
       "        return fig.toolbar_button_onclick(event['data']);\n",
       "    }\n",
       "    function toolbar_mouse_event(event) {\n",
       "        return fig.toolbar_button_onmouseover(event['data']);\n",
       "    }\n",
       "\n",
       "    for(var toolbar_ind in mpl.toolbar_items) {\n",
       "        var name = mpl.toolbar_items[toolbar_ind][0];\n",
       "        var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
       "        var image = mpl.toolbar_items[toolbar_ind][2];\n",
       "        var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
       "\n",
       "        if (!name) {\n",
       "            // put a spacer in here.\n",
       "            continue;\n",
       "        }\n",
       "        var button = $('<button/>');\n",
       "        button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
       "                        'ui-button-icon-only');\n",
       "        button.attr('role', 'button');\n",
       "        button.attr('aria-disabled', 'false');\n",
       "        button.click(method_name, toolbar_event);\n",
       "        button.mouseover(tooltip, toolbar_mouse_event);\n",
       "\n",
       "        var icon_img = $('<span/>');\n",
       "        icon_img.addClass('ui-button-icon-primary ui-icon');\n",
       "        icon_img.addClass(image);\n",
       "        icon_img.addClass('ui-corner-all');\n",
       "\n",
       "        var tooltip_span = $('<span/>');\n",
       "        tooltip_span.addClass('ui-button-text');\n",
       "        tooltip_span.html(tooltip);\n",
       "\n",
       "        button.append(icon_img);\n",
       "        button.append(tooltip_span);\n",
       "\n",
       "        nav_element.append(button);\n",
       "    }\n",
       "\n",
       "    var fmt_picker_span = $('<span/>');\n",
       "\n",
       "    var fmt_picker = $('<select/>');\n",
       "    fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
       "    fmt_picker_span.append(fmt_picker);\n",
       "    nav_element.append(fmt_picker_span);\n",
       "    this.format_dropdown = fmt_picker[0];\n",
       "\n",
       "    for (var ind in mpl.extensions) {\n",
       "        var fmt = mpl.extensions[ind];\n",
       "        var option = $(\n",
       "            '<option/>', {selected: fmt === mpl.default_extension}).html(fmt);\n",
       "        fmt_picker.append(option);\n",
       "    }\n",
       "\n",
       "    // Add hover states to the ui-buttons\n",
       "    $( \".ui-button\" ).hover(\n",
       "        function() { $(this).addClass(\"ui-state-hover\");},\n",
       "        function() { $(this).removeClass(\"ui-state-hover\");}\n",
       "    );\n",
       "\n",
       "    var status_bar = $('<span class=\"mpl-message\"/>');\n",
       "    nav_element.append(status_bar);\n",
       "    this.message = status_bar[0];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
       "    // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
       "    // which will in turn request a refresh of the image.\n",
       "    this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.send_message = function(type, properties) {\n",
       "    properties['type'] = type;\n",
       "    properties['figure_id'] = this.id;\n",
       "    this.ws.send(JSON.stringify(properties));\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.send_draw_message = function() {\n",
       "    if (!this.waiting) {\n",
       "        this.waiting = true;\n",
       "        this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
       "    }\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
       "    var format_dropdown = fig.format_dropdown;\n",
       "    var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
       "    fig.ondownload(fig, format);\n",
       "}\n",
       "\n",
       "\n",
       "mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
       "    var size = msg['size'];\n",
       "    if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
       "        fig._resize_canvas(size[0], size[1]);\n",
       "        fig.send_message(\"refresh\", {});\n",
       "    };\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
       "    var x0 = msg['x0'] / mpl.ratio;\n",
       "    var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
       "    var x1 = msg['x1'] / mpl.ratio;\n",
       "    var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
       "    x0 = Math.floor(x0) + 0.5;\n",
       "    y0 = Math.floor(y0) + 0.5;\n",
       "    x1 = Math.floor(x1) + 0.5;\n",
       "    y1 = Math.floor(y1) + 0.5;\n",
       "    var min_x = Math.min(x0, x1);\n",
       "    var min_y = Math.min(y0, y1);\n",
       "    var width = Math.abs(x1 - x0);\n",
       "    var height = Math.abs(y1 - y0);\n",
       "\n",
       "    fig.rubberband_context.clearRect(\n",
       "        0, 0, fig.canvas.width, fig.canvas.height);\n",
       "\n",
       "    fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
       "    // Updates the figure title.\n",
       "    fig.header.textContent = msg['label'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
       "    var cursor = msg['cursor'];\n",
       "    switch(cursor)\n",
       "    {\n",
       "    case 0:\n",
       "        cursor = 'pointer';\n",
       "        break;\n",
       "    case 1:\n",
       "        cursor = 'default';\n",
       "        break;\n",
       "    case 2:\n",
       "        cursor = 'crosshair';\n",
       "        break;\n",
       "    case 3:\n",
       "        cursor = 'move';\n",
       "        break;\n",
       "    }\n",
       "    fig.rubberband_canvas.style.cursor = cursor;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_message = function(fig, msg) {\n",
       "    fig.message.textContent = msg['message'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
       "    // Request the server to send over a new figure.\n",
       "    fig.send_draw_message();\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
       "    fig.image_mode = msg['mode'];\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.updated_canvas_event = function() {\n",
       "    // Called whenever the canvas gets updated.\n",
       "    this.send_message(\"ack\", {});\n",
       "}\n",
       "\n",
       "// A function to construct a web socket function for onmessage handling.\n",
       "// Called in the figure constructor.\n",
       "mpl.figure.prototype._make_on_message_function = function(fig) {\n",
       "    return function socket_on_message(evt) {\n",
       "        if (evt.data instanceof Blob) {\n",
       "            /* FIXME: We get \"Resource interpreted as Image but\n",
       "             * transferred with MIME type text/plain:\" errors on\n",
       "             * Chrome.  But how to set the MIME type?  It doesn't seem\n",
       "             * to be part of the websocket stream */\n",
       "            evt.data.type = \"image/png\";\n",
       "\n",
       "            /* Free the memory for the previous frames */\n",
       "            if (fig.imageObj.src) {\n",
       "                (window.URL || window.webkitURL).revokeObjectURL(\n",
       "                    fig.imageObj.src);\n",
       "            }\n",
       "\n",
       "            fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
       "                evt.data);\n",
       "            fig.updated_canvas_event();\n",
       "            fig.waiting = false;\n",
       "            return;\n",
       "        }\n",
       "        else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
       "            fig.imageObj.src = evt.data;\n",
       "            fig.updated_canvas_event();\n",
       "            fig.waiting = false;\n",
       "            return;\n",
       "        }\n",
       "\n",
       "        var msg = JSON.parse(evt.data);\n",
       "        var msg_type = msg['type'];\n",
       "\n",
       "        // Call the  \"handle_{type}\" callback, which takes\n",
       "        // the figure and JSON message as its only arguments.\n",
       "        try {\n",
       "            var callback = fig[\"handle_\" + msg_type];\n",
       "        } catch (e) {\n",
       "            console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
       "            return;\n",
       "        }\n",
       "\n",
       "        if (callback) {\n",
       "            try {\n",
       "                // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
       "                callback(fig, msg);\n",
       "            } catch (e) {\n",
       "                console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
       "            }\n",
       "        }\n",
       "    };\n",
       "}\n",
       "\n",
       "// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
       "mpl.findpos = function(e) {\n",
       "    //this section is from http://www.quirksmode.org/js/events_properties.html\n",
       "    var targ;\n",
       "    if (!e)\n",
       "        e = window.event;\n",
       "    if (e.target)\n",
       "        targ = e.target;\n",
       "    else if (e.srcElement)\n",
       "        targ = e.srcElement;\n",
       "    if (targ.nodeType == 3) // defeat Safari bug\n",
       "        targ = targ.parentNode;\n",
       "\n",
       "    // jQuery normalizes the pageX and pageY\n",
       "    // pageX,Y are the mouse positions relative to the document\n",
       "    // offset() returns the position of the element relative to the document\n",
       "    var x = e.pageX - $(targ).offset().left;\n",
       "    var y = e.pageY - $(targ).offset().top;\n",
       "\n",
       "    return {\"x\": x, \"y\": y};\n",
       "};\n",
       "\n",
       "/*\n",
       " * return a copy of an object with only non-object keys\n",
       " * we need this to avoid circular references\n",
       " * http://stackoverflow.com/a/24161582/3208463\n",
       " */\n",
       "function simpleKeys (original) {\n",
       "  return Object.keys(original).reduce(function (obj, key) {\n",
       "    if (typeof original[key] !== 'object')\n",
       "        obj[key] = original[key]\n",
       "    return obj;\n",
       "  }, {});\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.mouse_event = function(event, name) {\n",
       "    var canvas_pos = mpl.findpos(event)\n",
       "\n",
       "    if (name === 'button_press')\n",
       "    {\n",
       "        this.canvas.focus();\n",
       "        this.canvas_div.focus();\n",
       "    }\n",
       "\n",
       "    var x = canvas_pos.x * mpl.ratio;\n",
       "    var y = canvas_pos.y * mpl.ratio;\n",
       "\n",
       "    this.send_message(name, {x: x, y: y, button: event.button,\n",
       "                             step: event.step,\n",
       "                             guiEvent: simpleKeys(event)});\n",
       "\n",
       "    /* This prevents the web browser from automatically changing to\n",
       "     * the text insertion cursor when the button is pressed.  We want\n",
       "     * to control all of the cursor setting manually through the\n",
       "     * 'cursor' event from matplotlib */\n",
       "    event.preventDefault();\n",
       "    return false;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
       "    // Handle any extra behaviour associated with a key event\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.key_event = function(event, name) {\n",
       "\n",
       "    // Prevent repeat events\n",
       "    if (name == 'key_press')\n",
       "    {\n",
       "        if (event.which === this._key)\n",
       "            return;\n",
       "        else\n",
       "            this._key = event.which;\n",
       "    }\n",
       "    if (name == 'key_release')\n",
       "        this._key = null;\n",
       "\n",
       "    var value = '';\n",
       "    if (event.ctrlKey && event.which != 17)\n",
       "        value += \"ctrl+\";\n",
       "    if (event.altKey && event.which != 18)\n",
       "        value += \"alt+\";\n",
       "    if (event.shiftKey && event.which != 16)\n",
       "        value += \"shift+\";\n",
       "\n",
       "    value += 'k';\n",
       "    value += event.which.toString();\n",
       "\n",
       "    this._key_event_extra(event, name);\n",
       "\n",
       "    this.send_message(name, {key: value,\n",
       "                             guiEvent: simpleKeys(event)});\n",
       "    return false;\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
       "    if (name == 'download') {\n",
       "        this.handle_save(this, null);\n",
       "    } else {\n",
       "        this.send_message(\"toolbar_button\", {name: name});\n",
       "    }\n",
       "};\n",
       "\n",
       "mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
       "    this.message.textContent = tooltip;\n",
       "};\n",
       "mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
       "\n",
       "mpl.extensions = [\"eps\", \"jpeg\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\", \"tif\"];\n",
       "\n",
       "mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
       "    // Create a \"websocket\"-like object which calls the given IPython comm\n",
       "    // object with the appropriate methods. Currently this is a non binary\n",
       "    // socket, so there is still some room for performance tuning.\n",
       "    var ws = {};\n",
       "\n",
       "    ws.close = function() {\n",
       "        comm.close()\n",
       "    };\n",
       "    ws.send = function(m) {\n",
       "        //console.log('sending', m);\n",
       "        comm.send(m);\n",
       "    };\n",
       "    // Register the callback with on_msg.\n",
       "    comm.on_msg(function(msg) {\n",
       "        //console.log('receiving', msg['content']['data'], msg);\n",
       "        // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
       "        ws.onmessage(msg['content']['data'])\n",
       "    });\n",
       "    return ws;\n",
       "}\n",
       "\n",
       "mpl.mpl_figure_comm = function(comm, msg) {\n",
       "    // This is the function which gets called when the mpl process\n",
       "    // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
       "\n",
       "    var id = msg.content.data.id;\n",
       "    // Get hold of the div created by the display call when the Comm\n",
       "    // socket was opened in Python.\n",
       "    var element = $(\"#\" + id);\n",
       "    var ws_proxy = comm_websocket_adapter(comm)\n",
       "\n",
       "    function ondownload(figure, format) {\n",
       "        window.open(figure.imageObj.src);\n",
       "    }\n",
       "\n",
       "    var fig = new mpl.figure(id, ws_proxy,\n",
       "                           ondownload,\n",
       "                           element.get(0));\n",
       "\n",
       "    // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
       "    // web socket which is closed, not our websocket->open comm proxy.\n",
       "    ws_proxy.onopen();\n",
       "\n",
       "    fig.parent_element = element.get(0);\n",
       "    fig.cell_info = mpl.find_output_cell(\"<div id='\" + id + \"'></div>\");\n",
       "    if (!fig.cell_info) {\n",
       "        console.error(\"Failed to find cell for figure\", id, fig);\n",
       "        return;\n",
       "    }\n",
       "\n",
       "    var output_index = fig.cell_info[2]\n",
       "    var cell = fig.cell_info[0];\n",
       "\n",
       "};\n",
       "\n",
       "mpl.figure.prototype.handle_close = function(fig, msg) {\n",
       "    var width = fig.canvas.width/mpl.ratio\n",
       "    fig.root.unbind('remove')\n",
       "\n",
       "    // Update the output cell to use the data from the current canvas.\n",
       "    fig.push_to_output();\n",
       "    var dataURL = fig.canvas.toDataURL();\n",
       "    // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
       "    // the notebook keyboard shortcuts fail.\n",
       "    IPython.keyboard_manager.enable()\n",
       "    $(fig.parent_element).html('<img src=\"' + dataURL + '\" width=\"' + width + '\">');\n",
       "    fig.close_ws(fig, msg);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.close_ws = function(fig, msg){\n",
       "    fig.send_message('closing', msg);\n",
       "    // fig.ws.close()\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
       "    // Turn the data on the canvas into data in the output cell.\n",
       "    var width = this.canvas.width/mpl.ratio\n",
       "    var dataURL = this.canvas.toDataURL();\n",
       "    this.cell_info[1]['text/html'] = '<img src=\"' + dataURL + '\" width=\"' + width + '\">';\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.updated_canvas_event = function() {\n",
       "    // Tell IPython that the notebook contents must change.\n",
       "    IPython.notebook.set_dirty(true);\n",
       "    this.send_message(\"ack\", {});\n",
       "    var fig = this;\n",
       "    // Wait a second, then push the new image to the DOM so\n",
       "    // that it is saved nicely (might be nice to debounce this).\n",
       "    setTimeout(function () { fig.push_to_output() }, 1000);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._init_toolbar = function() {\n",
       "    var fig = this;\n",
       "\n",
       "    var nav_element = $('<div/>');\n",
       "    nav_element.attr('style', 'width: 100%');\n",
       "    this.root.append(nav_element);\n",
       "\n",
       "    // Define a callback function for later on.\n",
       "    function toolbar_event(event) {\n",
       "        return fig.toolbar_button_onclick(event['data']);\n",
       "    }\n",
       "    function toolbar_mouse_event(event) {\n",
       "        return fig.toolbar_button_onmouseover(event['data']);\n",
       "    }\n",
       "\n",
       "    for(var toolbar_ind in mpl.toolbar_items){\n",
       "        var name = mpl.toolbar_items[toolbar_ind][0];\n",
       "        var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
       "        var image = mpl.toolbar_items[toolbar_ind][2];\n",
       "        var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
       "\n",
       "        if (!name) { continue; };\n",
       "\n",
       "        var button = $('<button class=\"btn btn-default\" href=\"#\" title=\"' + name + '\"><i class=\"fa ' + image + ' fa-lg\"></i></button>');\n",
       "        button.click(method_name, toolbar_event);\n",
       "        button.mouseover(tooltip, toolbar_mouse_event);\n",
       "        nav_element.append(button);\n",
       "    }\n",
       "\n",
       "    // Add the status bar.\n",
       "    var status_bar = $('<span class=\"mpl-message\" style=\"text-align:right; float: right;\"/>');\n",
       "    nav_element.append(status_bar);\n",
       "    this.message = status_bar[0];\n",
       "\n",
       "    // Add the close button to the window.\n",
       "    var buttongrp = $('<div class=\"btn-group inline pull-right\"></div>');\n",
       "    var button = $('<button class=\"btn btn-mini btn-primary\" href=\"#\" title=\"Stop Interaction\"><i class=\"fa fa-power-off icon-remove icon-large\"></i></button>');\n",
       "    button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
       "    button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
       "    buttongrp.append(button);\n",
       "    var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
       "    titlebar.prepend(buttongrp);\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._root_extra_style = function(el){\n",
       "    var fig = this\n",
       "    el.on(\"remove\", function(){\n",
       "\tfig.close_ws(fig, {});\n",
       "    });\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._canvas_extra_style = function(el){\n",
       "    // this is important to make the div 'focusable\n",
       "    el.attr('tabindex', 0)\n",
       "    // reach out to IPython and tell the keyboard manager to turn it's self\n",
       "    // off when our div gets focus\n",
       "\n",
       "    // location in version 3\n",
       "    if (IPython.notebook.keyboard_manager) {\n",
       "        IPython.notebook.keyboard_manager.register_events(el);\n",
       "    }\n",
       "    else {\n",
       "        // location in version 2\n",
       "        IPython.keyboard_manager.register_events(el);\n",
       "    }\n",
       "\n",
       "}\n",
       "\n",
       "mpl.figure.prototype._key_event_extra = function(event, name) {\n",
       "    var manager = IPython.notebook.keyboard_manager;\n",
       "    if (!manager)\n",
       "        manager = IPython.keyboard_manager;\n",
       "\n",
       "    // Check for shift+enter\n",
       "    if (event.shiftKey && event.which == 13) {\n",
       "        this.canvas_div.blur();\n",
       "        event.shiftKey = false;\n",
       "        // Send a \"J\" for go to next cell\n",
       "        event.which = 74;\n",
       "        event.keyCode = 74;\n",
       "        manager.command_mode();\n",
       "        manager.handle_keydown(event);\n",
       "    }\n",
       "}\n",
       "\n",
       "mpl.figure.prototype.handle_save = function(fig, msg) {\n",
       "    fig.ondownload(fig, null);\n",
       "}\n",
       "\n",
       "\n",
       "mpl.find_output_cell = function(html_output) {\n",
       "    // Return the cell and output element which can be found *uniquely* in the notebook.\n",
       "    // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
       "    // IPython event is triggered only after the cells have been serialised, which for\n",
       "    // our purposes (turning an active figure into a static one), is too late.\n",
       "    var cells = IPython.notebook.get_cells();\n",
       "    var ncells = cells.length;\n",
       "    for (var i=0; i<ncells; i++) {\n",
       "        var cell = cells[i];\n",
       "        if (cell.cell_type === 'code'){\n",
       "            for (var j=0; j<cell.output_area.outputs.length; j++) {\n",
       "                var data = cell.output_area.outputs[j];\n",
       "                if (data.data) {\n",
       "                    // IPython >= 3 moved mimebundle to data attribute of output\n",
       "                    data = data.data;\n",
       "                }\n",
       "                if (data['text/html'] == html_output) {\n",
       "                    return [cell, data, j];\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "}\n",
       "\n",
       "// Register the function which deals with the matplotlib target/channel.\n",
       "// The kernel may be null if the page has been refreshed.\n",
       "if (IPython.notebook.kernel != null) {\n",
       "    IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
       "}\n"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<img src=\"\" width=\"640\">"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df_whole[['close']].tail(60).plot()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole = df_whole.dropna()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>RSV</th>\n",
       "      <th>K</th>\n",
       "      <th>D</th>\n",
       "      <th>J</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.07</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.20</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8824</td>\n",
       "      <td>500443.59</td>\n",
       "      <td>507862.882</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.11</td>\n",
       "      <td>0.13</td>\n",
       "      <td>1.2859</td>\n",
       "      <td>542160.55</td>\n",
       "      <td>553027.309</td>\n",
       "      <td>96.460177</td>\n",
       "      <td>92.785197</td>\n",
       "      <td>90.580209</td>\n",
       "      <td>97.195173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.23</td>\n",
       "      <td>10.48</td>\n",
       "      <td>10.24</td>\n",
       "      <td>0.24</td>\n",
       "      <td>2.3438</td>\n",
       "      <td>977699.37</td>\n",
       "      <td>1017495.116</td>\n",
       "      <td>98.437500</td>\n",
       "      <td>95.462604</td>\n",
       "      <td>92.892922</td>\n",
       "      <td>100.601966</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.57</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.48</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.1947</td>\n",
       "      <td>882811.92</td>\n",
       "      <td>910212.066</td>\n",
       "      <td>66.315789</td>\n",
       "      <td>83.355466</td>\n",
       "      <td>88.931210</td>\n",
       "      <td>72.203977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.49</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.43</td>\n",
       "      <td>10.25</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.7561</td>\n",
       "      <td>738793.26</td>\n",
       "      <td>769973.637</td>\n",
       "      <td>85.263158</td>\n",
       "      <td>84.087802</td>\n",
       "      <td>87.071892</td>\n",
       "      <td>78.119623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.32</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.43</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8629</td>\n",
       "      <td>659355.76</td>\n",
       "      <td>684465.646</td>\n",
       "      <td>73.563218</td>\n",
       "      <td>80.241977</td>\n",
       "      <td>84.576149</td>\n",
       "      <td>71.573634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.44</td>\n",
       "      <td>10.26</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.34</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5803</td>\n",
       "      <td>424413.57</td>\n",
       "      <td>438991.450</td>\n",
       "      <td>59.154930</td>\n",
       "      <td>72.775995</td>\n",
       "      <td>80.398241</td>\n",
       "      <td>57.531502</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.35</td>\n",
       "      <td>10.28</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.6809</td>\n",
       "      <td>537876.63</td>\n",
       "      <td>559384.396</td>\n",
       "      <td>57.692308</td>\n",
       "      <td>67.543953</td>\n",
       "      <td>75.939505</td>\n",
       "      <td>50.752848</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.40</td>\n",
       "      <td>10.55</td>\n",
       "      <td>10.37</td>\n",
       "      <td>10.52</td>\n",
       "      <td>10.35</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.6425</td>\n",
       "      <td>679240.88</td>\n",
       "      <td>711495.718</td>\n",
       "      <td>90.000000</td>\n",
       "      <td>75.229213</td>\n",
       "      <td>75.696418</td>\n",
       "      <td>74.294804</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.56</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.55</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>4.5627</td>\n",
       "      <td>2108361.85</td>\n",
       "      <td>2299718.224</td>\n",
       "      <td>95.789474</td>\n",
       "      <td>82.203580</td>\n",
       "      <td>77.903750</td>\n",
       "      <td>90.803238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5455</td>\n",
       "      <td>1035909.80</td>\n",
       "      <td>1141853.833</td>\n",
       "      <td>79.381443</td>\n",
       "      <td>81.251865</td>\n",
       "      <td>79.032842</td>\n",
       "      <td>85.689910</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.07</td>\n",
       "      <td>10.77</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.94</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5484</td>\n",
       "      <td>826631.10</td>\n",
       "      <td>904847.854</td>\n",
       "      <td>85.567010</td>\n",
       "      <td>82.701419</td>\n",
       "      <td>80.265199</td>\n",
       "      <td>87.573858</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-30</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.18</td>\n",
       "      <td>10.86</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4545</td>\n",
       "      <td>712001.01</td>\n",
       "      <td>785204.571</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>80.121020</td>\n",
       "      <td>80.216891</td>\n",
       "      <td>79.929279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.98</td>\n",
       "      <td>11.20</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.10</td>\n",
       "      <td>10.95</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.3699</td>\n",
       "      <td>831622.75</td>\n",
       "      <td>922602.874</td>\n",
       "      <td>89.361702</td>\n",
       "      <td>83.211835</td>\n",
       "      <td>81.218637</td>\n",
       "      <td>87.198231</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-01</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.25</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.9009</td>\n",
       "      <td>1014270.07</td>\n",
       "      <td>1127216.186</td>\n",
       "      <td>94.949495</td>\n",
       "      <td>87.133344</td>\n",
       "      <td>83.194719</td>\n",
       "      <td>95.010594</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.21</td>\n",
       "      <td>10.97</td>\n",
       "      <td>11.21</td>\n",
       "      <td>11.20</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0893</td>\n",
       "      <td>801936.63</td>\n",
       "      <td>889951.528</td>\n",
       "      <td>95.833333</td>\n",
       "      <td>90.037762</td>\n",
       "      <td>85.479211</td>\n",
       "      <td>99.154864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-12</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.31</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.21</td>\n",
       "      <td>-0.02</td>\n",
       "      <td>-0.1784</td>\n",
       "      <td>959936.90</td>\n",
       "      <td>1071873.084</td>\n",
       "      <td>87.234043</td>\n",
       "      <td>89.102239</td>\n",
       "      <td>86.688114</td>\n",
       "      <td>93.930490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.12</td>\n",
       "      <td>11.38</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.19</td>\n",
       "      <td>1.6979</td>\n",
       "      <td>1137365.74</td>\n",
       "      <td>1280182.096</td>\n",
       "      <td>96.511628</td>\n",
       "      <td>91.573708</td>\n",
       "      <td>88.317748</td>\n",
       "      <td>98.085627</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.30</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.25</td>\n",
       "      <td>11.38</td>\n",
       "      <td>-0.13</td>\n",
       "      <td>-1.1424</td>\n",
       "      <td>869185.19</td>\n",
       "      <td>977818.097</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>86.046645</td>\n",
       "      <td>87.560372</td>\n",
       "      <td>83.019192</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.23</td>\n",
       "      <td>11.23</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.25</td>\n",
       "      <td>-0.30</td>\n",
       "      <td>-2.6667</td>\n",
       "      <td>1100127.46</td>\n",
       "      <td>1213914.428</td>\n",
       "      <td>28.125000</td>\n",
       "      <td>66.733622</td>\n",
       "      <td>80.616034</td>\n",
       "      <td>38.968799</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.36</td>\n",
       "      <td>10.95</td>\n",
       "      <td>0.41</td>\n",
       "      <td>3.7443</td>\n",
       "      <td>1255522.21</td>\n",
       "      <td>1408279.680</td>\n",
       "      <td>90.909091</td>\n",
       "      <td>74.793728</td>\n",
       "      <td>78.674876</td>\n",
       "      <td>67.031431</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.62</td>\n",
       "      <td>11.24</td>\n",
       "      <td>11.27</td>\n",
       "      <td>11.36</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.7923</td>\n",
       "      <td>1270882.04</td>\n",
       "      <td>1445281.382</td>\n",
       "      <td>51.388889</td>\n",
       "      <td>66.991072</td>\n",
       "      <td>74.779754</td>\n",
       "      <td>51.413708</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.25</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.27</td>\n",
       "      <td>0.14</td>\n",
       "      <td>1.2422</td>\n",
       "      <td>832629.87</td>\n",
       "      <td>949430.819</td>\n",
       "      <td>70.833333</td>\n",
       "      <td>68.271940</td>\n",
       "      <td>72.610289</td>\n",
       "      <td>59.595241</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.38</td>\n",
       "      <td>11.55</td>\n",
       "      <td>11.28</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.41</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4382</td>\n",
       "      <td>754246.48</td>\n",
       "      <td>860591.070</td>\n",
       "      <td>63.888889</td>\n",
       "      <td>66.810836</td>\n",
       "      <td>70.677023</td>\n",
       "      <td>59.078461</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.35</td>\n",
       "      <td>11.57</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.54</td>\n",
       "      <td>11.36</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.5845</td>\n",
       "      <td>1184047.79</td>\n",
       "      <td>1343020.336</td>\n",
       "      <td>88.888889</td>\n",
       "      <td>74.170478</td>\n",
       "      <td>71.841555</td>\n",
       "      <td>78.828326</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.70</td>\n",
       "      <td>12.64</td>\n",
       "      <td>11.57</td>\n",
       "      <td>12.55</td>\n",
       "      <td>11.54</td>\n",
       "      <td>1.01</td>\n",
       "      <td>8.7522</td>\n",
       "      <td>2824935.02</td>\n",
       "      <td>3415946.860</td>\n",
       "      <td>94.827586</td>\n",
       "      <td>81.056363</td>\n",
       "      <td>74.913238</td>\n",
       "      <td>93.342612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-26</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.55</td>\n",
       "      <td>12.57</td>\n",
       "      <td>12.15</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.55</td>\n",
       "      <td>-0.35</td>\n",
       "      <td>-2.7888</td>\n",
       "      <td>2017544.93</td>\n",
       "      <td>2485673.356</td>\n",
       "      <td>74.712644</td>\n",
       "      <td>78.941753</td>\n",
       "      <td>76.256100</td>\n",
       "      <td>84.313058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-27</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.24</td>\n",
       "      <td>12.66</td>\n",
       "      <td>12.15</td>\n",
       "      <td>12.40</td>\n",
       "      <td>12.20</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.6393</td>\n",
       "      <td>1979013.88</td>\n",
       "      <td>2454404.411</td>\n",
       "      <td>85.227273</td>\n",
       "      <td>81.036951</td>\n",
       "      <td>77.849736</td>\n",
       "      <td>87.411380</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.44</td>\n",
       "      <td>12.61</td>\n",
       "      <td>12.27</td>\n",
       "      <td>12.36</td>\n",
       "      <td>12.40</td>\n",
       "      <td>-0.04</td>\n",
       "      <td>-0.3226</td>\n",
       "      <td>1113099.80</td>\n",
       "      <td>1383110.810</td>\n",
       "      <td>81.481481</td>\n",
       "      <td>81.185129</td>\n",
       "      <td>78.961542</td>\n",
       "      <td>85.632302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-01</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.36</td>\n",
       "      <td>0.40</td>\n",
       "      <td>3.2362</td>\n",
       "      <td>1712679.16</td>\n",
       "      <td>2137669.556</td>\n",
       "      <td>98.773006</td>\n",
       "      <td>87.047785</td>\n",
       "      <td>81.656970</td>\n",
       "      <td>97.829414</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.88</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.72</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.88</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>-0.7764</td>\n",
       "      <td>528716.14</td>\n",
       "      <td>676604.872</td>\n",
       "      <td>27.710843</td>\n",
       "      <td>40.903345</td>\n",
       "      <td>46.958157</td>\n",
       "      <td>28.793722</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-09</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.88</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.72</td>\n",
       "      <td>12.74</td>\n",
       "      <td>12.78</td>\n",
       "      <td>-0.04</td>\n",
       "      <td>-0.3130</td>\n",
       "      <td>408553.77</td>\n",
       "      <td>522027.888</td>\n",
       "      <td>22.891566</td>\n",
       "      <td>34.899419</td>\n",
       "      <td>42.938578</td>\n",
       "      <td>18.821102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-10</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.98</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.74</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.3925</td>\n",
       "      <td>666674.95</td>\n",
       "      <td>853689.950</td>\n",
       "      <td>41.379310</td>\n",
       "      <td>37.059383</td>\n",
       "      <td>40.978846</td>\n",
       "      <td>29.220456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.67</td>\n",
       "      <td>12.71</td>\n",
       "      <td>12.47</td>\n",
       "      <td>12.59</td>\n",
       "      <td>12.79</td>\n",
       "      <td>-0.20</td>\n",
       "      <td>-1.5637</td>\n",
       "      <td>446214.40</td>\n",
       "      <td>562008.050</td>\n",
       "      <td>18.181818</td>\n",
       "      <td>30.766861</td>\n",
       "      <td>37.574851</td>\n",
       "      <td>17.150882</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.57</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.59</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2.1446</td>\n",
       "      <td>686086.87</td>\n",
       "      <td>874856.562</td>\n",
       "      <td>59.090909</td>\n",
       "      <td>40.208211</td>\n",
       "      <td>38.452638</td>\n",
       "      <td>43.719356</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.93</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.87</td>\n",
       "      <td>12.86</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0778</td>\n",
       "      <td>656396.40</td>\n",
       "      <td>843649.273</td>\n",
       "      <td>78.431373</td>\n",
       "      <td>52.949265</td>\n",
       "      <td>43.284847</td>\n",
       "      <td>72.278100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.68</td>\n",
       "      <td>12.87</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-1.4763</td>\n",
       "      <td>789154.98</td>\n",
       "      <td>997623.816</td>\n",
       "      <td>41.176471</td>\n",
       "      <td>49.025000</td>\n",
       "      <td>45.198231</td>\n",
       "      <td>56.678538</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.77</td>\n",
       "      <td>13.04</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.68</td>\n",
       "      <td>0.21</td>\n",
       "      <td>1.6562</td>\n",
       "      <td>1331164.77</td>\n",
       "      <td>1713215.766</td>\n",
       "      <td>73.684211</td>\n",
       "      <td>57.244737</td>\n",
       "      <td>49.213733</td>\n",
       "      <td>73.306744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.86</td>\n",
       "      <td>13.05</td>\n",
       "      <td>12.77</td>\n",
       "      <td>12.99</td>\n",
       "      <td>12.89</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.7758</td>\n",
       "      <td>818455.83</td>\n",
       "      <td>1058524.019</td>\n",
       "      <td>89.655172</td>\n",
       "      <td>68.048215</td>\n",
       "      <td>55.491894</td>\n",
       "      <td>93.160859</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.70</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.45</td>\n",
       "      <td>12.99</td>\n",
       "      <td>0.46</td>\n",
       "      <td>3.5412</td>\n",
       "      <td>2122448.34</td>\n",
       "      <td>2861879.086</td>\n",
       "      <td>79.674797</td>\n",
       "      <td>71.923742</td>\n",
       "      <td>60.969177</td>\n",
       "      <td>93.832874</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.37</td>\n",
       "      <td>13.42</td>\n",
       "      <td>13.16</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.45</td>\n",
       "      <td>-0.22</td>\n",
       "      <td>-1.6357</td>\n",
       "      <td>1032802.74</td>\n",
       "      <td>1368222.854</td>\n",
       "      <td>61.788618</td>\n",
       "      <td>68.545368</td>\n",
       "      <td>63.494574</td>\n",
       "      <td>78.646956</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.31</td>\n",
       "      <td>13.11</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.23</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>646989.63</td>\n",
       "      <td>855052.110</td>\n",
       "      <td>61.788618</td>\n",
       "      <td>66.293118</td>\n",
       "      <td>64.427422</td>\n",
       "      <td>70.024510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.17</td>\n",
       "      <td>13.28</td>\n",
       "      <td>13.11</td>\n",
       "      <td>13.24</td>\n",
       "      <td>13.23</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0756</td>\n",
       "      <td>566001.61</td>\n",
       "      <td>747473.770</td>\n",
       "      <td>60.344828</td>\n",
       "      <td>64.310354</td>\n",
       "      <td>64.388399</td>\n",
       "      <td>64.154265</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-27</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.64</td>\n",
       "      <td>13.25</td>\n",
       "      <td>13.50</td>\n",
       "      <td>13.24</td>\n",
       "      <td>0.26</td>\n",
       "      <td>1.9637</td>\n",
       "      <td>936829.90</td>\n",
       "      <td>1263809.737</td>\n",
       "      <td>82.758621</td>\n",
       "      <td>70.459776</td>\n",
       "      <td>66.412192</td>\n",
       "      <td>78.554946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.56</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.50</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.1481</td>\n",
       "      <td>771564.17</td>\n",
       "      <td>1038718.080</td>\n",
       "      <td>84.482759</td>\n",
       "      <td>75.134104</td>\n",
       "      <td>69.319496</td>\n",
       "      <td>86.763320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.48</td>\n",
       "      <td>14.10</td>\n",
       "      <td>13.45</td>\n",
       "      <td>14.02</td>\n",
       "      <td>13.52</td>\n",
       "      <td>0.50</td>\n",
       "      <td>3.6982</td>\n",
       "      <td>1108722.39</td>\n",
       "      <td>1541638.203</td>\n",
       "      <td>94.482759</td>\n",
       "      <td>81.583655</td>\n",
       "      <td>73.407549</td>\n",
       "      <td>97.935868</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-30</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>14.02</td>\n",
       "      <td>14.32</td>\n",
       "      <td>13.88</td>\n",
       "      <td>13.93</td>\n",
       "      <td>14.02</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.6419</td>\n",
       "      <td>819540.43</td>\n",
       "      <td>1155968.238</td>\n",
       "      <td>74.838710</td>\n",
       "      <td>79.335340</td>\n",
       "      <td>75.383479</td>\n",
       "      <td>87.239062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-06</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.89</td>\n",
       "      <td>13.61</td>\n",
       "      <td>13.77</td>\n",
       "      <td>13.93</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.1486</td>\n",
       "      <td>1008998.02</td>\n",
       "      <td>1382727.481</td>\n",
       "      <td>54.545455</td>\n",
       "      <td>71.072045</td>\n",
       "      <td>73.946335</td>\n",
       "      <td>65.323466</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.60</td>\n",
       "      <td>13.69</td>\n",
       "      <td>13.77</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.5810</td>\n",
       "      <td>662749.23</td>\n",
       "      <td>904349.531</td>\n",
       "      <td>47.933884</td>\n",
       "      <td>63.359325</td>\n",
       "      <td>70.417331</td>\n",
       "      <td>49.243312</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>14.02</td>\n",
       "      <td>13.68</td>\n",
       "      <td>13.95</td>\n",
       "      <td>13.69</td>\n",
       "      <td>0.26</td>\n",
       "      <td>1.8992</td>\n",
       "      <td>934781.70</td>\n",
       "      <td>1297924.588</td>\n",
       "      <td>69.421488</td>\n",
       "      <td>65.380046</td>\n",
       "      <td>68.738236</td>\n",
       "      <td>58.663665</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.92</td>\n",
       "      <td>14.13</td>\n",
       "      <td>13.90</td>\n",
       "      <td>14.00</td>\n",
       "      <td>13.95</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.3584</td>\n",
       "      <td>612862.29</td>\n",
       "      <td>859156.594</td>\n",
       "      <td>73.553719</td>\n",
       "      <td>68.104603</td>\n",
       "      <td>68.527025</td>\n",
       "      <td>67.259760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-12</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.95</td>\n",
       "      <td>14.05</td>\n",
       "      <td>13.72</td>\n",
       "      <td>13.79</td>\n",
       "      <td>14.00</td>\n",
       "      <td>-0.21</td>\n",
       "      <td>-1.5000</td>\n",
       "      <td>558511.14</td>\n",
       "      <td>772109.502</td>\n",
       "      <td>50.467290</td>\n",
       "      <td>62.225499</td>\n",
       "      <td>66.426516</td>\n",
       "      <td>53.823464</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.75</td>\n",
       "      <td>13.78</td>\n",
       "      <td>13.53</td>\n",
       "      <td>13.63</td>\n",
       "      <td>13.79</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.1603</td>\n",
       "      <td>640358.79</td>\n",
       "      <td>871062.043</td>\n",
       "      <td>34.285714</td>\n",
       "      <td>52.912237</td>\n",
       "      <td>61.921757</td>\n",
       "      <td>34.893199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.55</td>\n",
       "      <td>13.59</td>\n",
       "      <td>13.22</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.63</td>\n",
       "      <td>-0.33</td>\n",
       "      <td>-2.4211</td>\n",
       "      <td>944672.09</td>\n",
       "      <td>1259440.848</td>\n",
       "      <td>7.272727</td>\n",
       "      <td>37.699067</td>\n",
       "      <td>53.847527</td>\n",
       "      <td>5.402148</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.39</td>\n",
       "      <td>13.43</td>\n",
       "      <td>13.14</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.30</td>\n",
       "      <td>-0.07</td>\n",
       "      <td>-0.5263</td>\n",
       "      <td>756794.47</td>\n",
       "      <td>1004313.267</td>\n",
       "      <td>7.627119</td>\n",
       "      <td>27.675084</td>\n",
       "      <td>45.123379</td>\n",
       "      <td>-7.221506</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.34</td>\n",
       "      <td>13.12</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.23</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2268</td>\n",
       "      <td>637208.57</td>\n",
       "      <td>843479.669</td>\n",
       "      <td>7.920792</td>\n",
       "      <td>21.090320</td>\n",
       "      <td>37.112360</td>\n",
       "      <td>-10.953759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.41</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.20</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.2121</td>\n",
       "      <td>600368.64</td>\n",
       "      <td>801755.671</td>\n",
       "      <td>23.762376</td>\n",
       "      <td>21.981006</td>\n",
       "      <td>32.068575</td>\n",
       "      <td>1.805867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.38</td>\n",
       "      <td>13.62</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.51</td>\n",
       "      <td>13.36</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.1228</td>\n",
       "      <td>690851.07</td>\n",
       "      <td>929928.885</td>\n",
       "      <td>38.613861</td>\n",
       "      <td>27.525291</td>\n",
       "      <td>30.554147</td>\n",
       "      <td>21.467579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.57</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.40</td>\n",
       "      <td>13.51</td>\n",
       "      <td>-0.11</td>\n",
       "      <td>-0.8142</td>\n",
       "      <td>552312.00</td>\n",
       "      <td>742797.057</td>\n",
       "      <td>27.722772</td>\n",
       "      <td>27.591118</td>\n",
       "      <td>29.566471</td>\n",
       "      <td>23.640413</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.40</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.5821</td>\n",
       "      <td>856237.33</td>\n",
       "      <td>1119433.491</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>18.394079</td>\n",
       "      <td>25.842340</td>\n",
       "      <td>3.497556</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>328 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2019-01-14  000001.SZ  10.22  10.25  10.07  10.11      10.20   -0.09  -0.8824   \n",
       "2019-01-15  000001.SZ  10.11  10.28  10.09  10.24      10.11    0.13   1.2859   \n",
       "2019-01-16  000001.SZ  10.24  10.50  10.23  10.48      10.24    0.24   2.3438   \n",
       "2019-01-17  000001.SZ  10.54  10.57  10.17  10.25      10.48   -0.23  -2.1947   \n",
       "2019-01-18  000001.SZ  10.34  10.49  10.28  10.43      10.25    0.18   1.7561   \n",
       "2019-01-21  000001.SZ  10.34  10.47  10.32  10.34      10.43   -0.09  -0.8629   \n",
       "2019-01-22  000001.SZ  10.34  10.44  10.26  10.28      10.34   -0.06  -0.5803   \n",
       "2019-01-23  000001.SZ  10.29  10.47  10.29  10.35      10.28    0.07   0.6809   \n",
       "2019-01-24  000001.SZ  10.40  10.55  10.37  10.52      10.35    0.17   1.6425   \n",
       "2019-01-25  000001.SZ  10.56  11.04  10.55  11.00      10.52    0.48   4.5627   \n",
       "2019-01-28  000001.SZ  11.04  11.14  10.88  10.94      11.00   -0.06  -0.5455   \n",
       "2019-01-29  000001.SZ  10.96  11.07  10.77  11.00      10.94    0.06   0.5484   \n",
       "2019-01-30  000001.SZ  10.95  11.18  10.86  10.95      11.00   -0.05  -0.4545   \n",
       "2019-01-31  000001.SZ  10.98  11.20  10.94  11.10      10.95    0.15   1.3699   \n",
       "2019-02-01  000001.SZ  11.20  11.25  10.96  11.20      11.10    0.10   0.9009   \n",
       "2019-02-11  000001.SZ  11.08  11.21  10.97  11.21      11.20    0.01   0.0893   \n",
       "2019-02-12  000001.SZ  11.20  11.31  11.03  11.19      11.21   -0.02  -0.1784   \n",
       "2019-02-13  000001.SZ  11.19  11.41  11.12  11.38      11.19    0.19   1.6979   \n",
       "2019-02-14  000001.SZ  11.30  11.33  11.19  11.25      11.38   -0.13  -1.1424   \n",
       "2019-02-15  000001.SZ  11.23  11.23  10.90  10.95      11.25   -0.30  -2.6667   \n",
       "2019-02-18  000001.SZ  11.05  11.36  11.04  11.36      10.95    0.41   3.7443   \n",
       "2019-02-19  000001.SZ  11.36  11.62  11.24  11.27      11.36   -0.09  -0.7923   \n",
       "2019-02-20  000001.SZ  11.33  11.53  11.25  11.41      11.27    0.14   1.2422   \n",
       "2019-02-21  000001.SZ  11.38  11.55  11.28  11.36      11.41   -0.05  -0.4382   \n",
       "2019-02-22  000001.SZ  11.35  11.57  11.15  11.54      11.36    0.18   1.5845   \n",
       "2019-02-25  000001.SZ  11.70  12.64  11.57  12.55      11.54    1.01   8.7522   \n",
       "2019-02-26  000001.SZ  12.55  12.57  12.15  12.20      12.55   -0.35  -2.7888   \n",
       "2019-02-27  000001.SZ  12.24  12.66  12.15  12.40      12.20    0.20   1.6393   \n",
       "2019-02-28  000001.SZ  12.44  12.61  12.27  12.36      12.40   -0.04  -0.3226   \n",
       "2019-03-01  000001.SZ  12.48  12.78  12.20  12.76      12.36    0.40   3.2362   \n",
       "...               ...    ...    ...    ...    ...        ...     ...      ...   \n",
       "2020-04-08  000001.SZ  12.88  12.92  12.72  12.78      12.88   -0.10  -0.7764   \n",
       "2020-04-09  000001.SZ  12.88  12.89  12.72  12.74      12.78   -0.04  -0.3130   \n",
       "2020-04-10  000001.SZ  12.76  12.98  12.65  12.79      12.74    0.05   0.3925   \n",
       "2020-04-13  000001.SZ  12.67  12.71  12.47  12.59      12.79   -0.20  -1.5637   \n",
       "2020-04-14  000001.SZ  12.65  12.86  12.57  12.86      12.59    0.27   2.1446   \n",
       "2020-04-15  000001.SZ  12.86  12.93  12.78  12.87      12.86    0.01   0.0778   \n",
       "2020-04-16  000001.SZ  12.79  12.79  12.54  12.68      12.87   -0.19  -1.4763   \n",
       "2020-04-17  000001.SZ  12.77  13.04  12.65  12.89      12.68    0.21   1.6562   \n",
       "2020-04-20  000001.SZ  12.86  13.05  12.77  12.99      12.89    0.10   0.7758   \n",
       "2020-04-21  000001.SZ  13.30  13.70  13.30  13.45      12.99    0.46   3.5412   \n",
       "2020-04-22  000001.SZ  13.37  13.42  13.16  13.23      13.45   -0.22  -1.6357   \n",
       "2020-04-23  000001.SZ  13.23  13.31  13.11  13.23      13.23    0.00   0.0000   \n",
       "2020-04-24  000001.SZ  13.17  13.28  13.11  13.24      13.23    0.01   0.0756   \n",
       "2020-04-27  000001.SZ  13.30  13.64  13.25  13.50      13.24    0.26   1.9637   \n",
       "2020-04-28  000001.SZ  13.45  13.56  13.27  13.52      13.50    0.02   0.1481   \n",
       "2020-04-29  000001.SZ  13.48  14.10  13.45  14.02      13.52    0.50   3.6982   \n",
       "2020-04-30  000001.SZ  14.02  14.32  13.88  13.93      14.02   -0.09  -0.6419   \n",
       "2020-05-06  000001.SZ  13.76  13.89  13.61  13.77      13.93   -0.16  -1.1486   \n",
       "2020-05-07  000001.SZ  13.76  13.76  13.60  13.69      13.77   -0.08  -0.5810   \n",
       "2020-05-08  000001.SZ  13.76  14.02  13.68  13.95      13.69    0.26   1.8992   \n",
       "2020-05-11  000001.SZ  13.92  14.13  13.90  14.00      13.95    0.05   0.3584   \n",
       "2020-05-12  000001.SZ  13.95  14.05  13.72  13.79      14.00   -0.21  -1.5000   \n",
       "2020-05-13  000001.SZ  13.75  13.78  13.53  13.63      13.79   -0.16  -1.1603   \n",
       "2020-05-14  000001.SZ  13.55  13.59  13.22  13.30      13.63   -0.33  -2.4211   \n",
       "2020-05-15  000001.SZ  13.39  13.43  13.14  13.23      13.30   -0.07  -0.5263   \n",
       "2020-05-18  000001.SZ  13.20  13.34  13.12  13.20      13.23   -0.03  -0.2268   \n",
       "2020-05-19  000001.SZ  13.41  13.45  13.27  13.36      13.20    0.16   1.2121   \n",
       "2020-05-20  000001.SZ  13.38  13.62  13.27  13.51      13.36    0.15   1.1228   \n",
       "2020-05-21  000001.SZ  13.52  13.57  13.36  13.40      13.51   -0.11  -0.8142   \n",
       "2020-05-22  000001.SZ  13.33  13.34  12.92  12.92      13.40   -0.48  -3.5821   \n",
       "\n",
       "                   vol       amount        RSV          K          D  \\\n",
       "trade_date                                                             \n",
       "2019-01-14   500443.59   507862.882  87.272727  87.272727  87.272727   \n",
       "2019-01-15   542160.55   553027.309  96.460177  92.785197  90.580209   \n",
       "2019-01-16   977699.37  1017495.116  98.437500  95.462604  92.892922   \n",
       "2019-01-17   882811.92   910212.066  66.315789  83.355466  88.931210   \n",
       "2019-01-18   738793.26   769973.637  85.263158  84.087802  87.071892   \n",
       "2019-01-21   659355.76   684465.646  73.563218  80.241977  84.576149   \n",
       "2019-01-22   424413.57   438991.450  59.154930  72.775995  80.398241   \n",
       "2019-01-23   537876.63   559384.396  57.692308  67.543953  75.939505   \n",
       "2019-01-24   679240.88   711495.718  90.000000  75.229213  75.696418   \n",
       "2019-01-25  2108361.85  2299718.224  95.789474  82.203580  77.903750   \n",
       "2019-01-28  1035909.80  1141853.833  79.381443  81.251865  79.032842   \n",
       "2019-01-29   826631.10   904847.854  85.567010  82.701419  80.265199   \n",
       "2019-01-30   712001.01   785204.571  75.000000  80.121020  80.216891   \n",
       "2019-01-31   831622.75   922602.874  89.361702  83.211835  81.218637   \n",
       "2019-02-01  1014270.07  1127216.186  94.949495  87.133344  83.194719   \n",
       "2019-02-11   801936.63   889951.528  95.833333  90.037762  85.479211   \n",
       "2019-02-12   959936.90  1071873.084  87.234043  89.102239  86.688114   \n",
       "2019-02-13  1137365.74  1280182.096  96.511628  91.573708  88.317748   \n",
       "2019-02-14   869185.19   977818.097  75.000000  86.046645  87.560372   \n",
       "2019-02-15  1100127.46  1213914.428  28.125000  66.733622  80.616034   \n",
       "2019-02-18  1255522.21  1408279.680  90.909091  74.793728  78.674876   \n",
       "2019-02-19  1270882.04  1445281.382  51.388889  66.991072  74.779754   \n",
       "2019-02-20   832629.87   949430.819  70.833333  68.271940  72.610289   \n",
       "2019-02-21   754246.48   860591.070  63.888889  66.810836  70.677023   \n",
       "2019-02-22  1184047.79  1343020.336  88.888889  74.170478  71.841555   \n",
       "2019-02-25  2824935.02  3415946.860  94.827586  81.056363  74.913238   \n",
       "2019-02-26  2017544.93  2485673.356  74.712644  78.941753  76.256100   \n",
       "2019-02-27  1979013.88  2454404.411  85.227273  81.036951  77.849736   \n",
       "2019-02-28  1113099.80  1383110.810  81.481481  81.185129  78.961542   \n",
       "2019-03-01  1712679.16  2137669.556  98.773006  87.047785  81.656970   \n",
       "...                ...          ...        ...        ...        ...   \n",
       "2020-04-08   528716.14   676604.872  27.710843  40.903345  46.958157   \n",
       "2020-04-09   408553.77   522027.888  22.891566  34.899419  42.938578   \n",
       "2020-04-10   666674.95   853689.950  41.379310  37.059383  40.978846   \n",
       "2020-04-13   446214.40   562008.050  18.181818  30.766861  37.574851   \n",
       "2020-04-14   686086.87   874856.562  59.090909  40.208211  38.452638   \n",
       "2020-04-15   656396.40   843649.273  78.431373  52.949265  43.284847   \n",
       "2020-04-16   789154.98   997623.816  41.176471  49.025000  45.198231   \n",
       "2020-04-17  1331164.77  1713215.766  73.684211  57.244737  49.213733   \n",
       "2020-04-20   818455.83  1058524.019  89.655172  68.048215  55.491894   \n",
       "2020-04-21  2122448.34  2861879.086  79.674797  71.923742  60.969177   \n",
       "2020-04-22  1032802.74  1368222.854  61.788618  68.545368  63.494574   \n",
       "2020-04-23   646989.63   855052.110  61.788618  66.293118  64.427422   \n",
       "2020-04-24   566001.61   747473.770  60.344828  64.310354  64.388399   \n",
       "2020-04-27   936829.90  1263809.737  82.758621  70.459776  66.412192   \n",
       "2020-04-28   771564.17  1038718.080  84.482759  75.134104  69.319496   \n",
       "2020-04-29  1108722.39  1541638.203  94.482759  81.583655  73.407549   \n",
       "2020-04-30   819540.43  1155968.238  74.838710  79.335340  75.383479   \n",
       "2020-05-06  1008998.02  1382727.481  54.545455  71.072045  73.946335   \n",
       "2020-05-07   662749.23   904349.531  47.933884  63.359325  70.417331   \n",
       "2020-05-08   934781.70  1297924.588  69.421488  65.380046  68.738236   \n",
       "2020-05-11   612862.29   859156.594  73.553719  68.104603  68.527025   \n",
       "2020-05-12   558511.14   772109.502  50.467290  62.225499  66.426516   \n",
       "2020-05-13   640358.79   871062.043  34.285714  52.912237  61.921757   \n",
       "2020-05-14   944672.09  1259440.848   7.272727  37.699067  53.847527   \n",
       "2020-05-15   756794.47  1004313.267   7.627119  27.675084  45.123379   \n",
       "2020-05-18   637208.57   843479.669   7.920792  21.090320  37.112360   \n",
       "2020-05-19   600368.64   801755.671  23.762376  21.981006  32.068575   \n",
       "2020-05-20   690851.07   929928.885  38.613861  27.525291  30.554147   \n",
       "2020-05-21   552312.00   742797.057  27.722772  27.591118  29.566471   \n",
       "2020-05-22   856237.33  1119433.491   0.000000  18.394079  25.842340   \n",
       "\n",
       "                     J  \n",
       "trade_date              \n",
       "2019-01-14   87.272727  \n",
       "2019-01-15   97.195173  \n",
       "2019-01-16  100.601966  \n",
       "2019-01-17   72.203977  \n",
       "2019-01-18   78.119623  \n",
       "2019-01-21   71.573634  \n",
       "2019-01-22   57.531502  \n",
       "2019-01-23   50.752848  \n",
       "2019-01-24   74.294804  \n",
       "2019-01-25   90.803238  \n",
       "2019-01-28   85.689910  \n",
       "2019-01-29   87.573858  \n",
       "2019-01-30   79.929279  \n",
       "2019-01-31   87.198231  \n",
       "2019-02-01   95.010594  \n",
       "2019-02-11   99.154864  \n",
       "2019-02-12   93.930490  \n",
       "2019-02-13   98.085627  \n",
       "2019-02-14   83.019192  \n",
       "2019-02-15   38.968799  \n",
       "2019-02-18   67.031431  \n",
       "2019-02-19   51.413708  \n",
       "2019-02-20   59.595241  \n",
       "2019-02-21   59.078461  \n",
       "2019-02-22   78.828326  \n",
       "2019-02-25   93.342612  \n",
       "2019-02-26   84.313058  \n",
       "2019-02-27   87.411380  \n",
       "2019-02-28   85.632302  \n",
       "2019-03-01   97.829414  \n",
       "...                ...  \n",
       "2020-04-08   28.793722  \n",
       "2020-04-09   18.821102  \n",
       "2020-04-10   29.220456  \n",
       "2020-04-13   17.150882  \n",
       "2020-04-14   43.719356  \n",
       "2020-04-15   72.278100  \n",
       "2020-04-16   56.678538  \n",
       "2020-04-17   73.306744  \n",
       "2020-04-20   93.160859  \n",
       "2020-04-21   93.832874  \n",
       "2020-04-22   78.646956  \n",
       "2020-04-23   70.024510  \n",
       "2020-04-24   64.154265  \n",
       "2020-04-27   78.554946  \n",
       "2020-04-28   86.763320  \n",
       "2020-04-29   97.935868  \n",
       "2020-04-30   87.239062  \n",
       "2020-05-06   65.323466  \n",
       "2020-05-07   49.243312  \n",
       "2020-05-08   58.663665  \n",
       "2020-05-11   67.259760  \n",
       "2020-05-12   53.823464  \n",
       "2020-05-13   34.893199  \n",
       "2020-05-14    5.402148  \n",
       "2020-05-15   -7.221506  \n",
       "2020-05-18  -10.953759  \n",
       "2020-05-19    1.805867  \n",
       "2020-05-20   21.467579  \n",
       "2020-05-21   23.640413  \n",
       "2020-05-22    3.497556  \n",
       "\n",
       "[328 rows x 14 columns]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole['KDJ金叉死叉'] = ''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>RSV</th>\n",
       "      <th>K</th>\n",
       "      <th>D</th>\n",
       "      <th>J</th>\n",
       "      <th>KDJ金叉死叉</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.07</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.20</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8824</td>\n",
       "      <td>500443.59</td>\n",
       "      <td>507862.882</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.11</td>\n",
       "      <td>0.13</td>\n",
       "      <td>1.2859</td>\n",
       "      <td>542160.55</td>\n",
       "      <td>553027.309</td>\n",
       "      <td>96.460177</td>\n",
       "      <td>92.785197</td>\n",
       "      <td>90.580209</td>\n",
       "      <td>97.195173</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.23</td>\n",
       "      <td>10.48</td>\n",
       "      <td>10.24</td>\n",
       "      <td>0.24</td>\n",
       "      <td>2.3438</td>\n",
       "      <td>977699.37</td>\n",
       "      <td>1017495.116</td>\n",
       "      <td>98.437500</td>\n",
       "      <td>95.462604</td>\n",
       "      <td>92.892922</td>\n",
       "      <td>100.601966</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.57</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.48</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.1947</td>\n",
       "      <td>882811.92</td>\n",
       "      <td>910212.066</td>\n",
       "      <td>66.315789</td>\n",
       "      <td>83.355466</td>\n",
       "      <td>88.931210</td>\n",
       "      <td>72.203977</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.49</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.43</td>\n",
       "      <td>10.25</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.7561</td>\n",
       "      <td>738793.26</td>\n",
       "      <td>769973.637</td>\n",
       "      <td>85.263158</td>\n",
       "      <td>84.087802</td>\n",
       "      <td>87.071892</td>\n",
       "      <td>78.119623</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.32</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.43</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8629</td>\n",
       "      <td>659355.76</td>\n",
       "      <td>684465.646</td>\n",
       "      <td>73.563218</td>\n",
       "      <td>80.241977</td>\n",
       "      <td>84.576149</td>\n",
       "      <td>71.573634</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.44</td>\n",
       "      <td>10.26</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.34</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5803</td>\n",
       "      <td>424413.57</td>\n",
       "      <td>438991.450</td>\n",
       "      <td>59.154930</td>\n",
       "      <td>72.775995</td>\n",
       "      <td>80.398241</td>\n",
       "      <td>57.531502</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.35</td>\n",
       "      <td>10.28</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.6809</td>\n",
       "      <td>537876.63</td>\n",
       "      <td>559384.396</td>\n",
       "      <td>57.692308</td>\n",
       "      <td>67.543953</td>\n",
       "      <td>75.939505</td>\n",
       "      <td>50.752848</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.40</td>\n",
       "      <td>10.55</td>\n",
       "      <td>10.37</td>\n",
       "      <td>10.52</td>\n",
       "      <td>10.35</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.6425</td>\n",
       "      <td>679240.88</td>\n",
       "      <td>711495.718</td>\n",
       "      <td>90.000000</td>\n",
       "      <td>75.229213</td>\n",
       "      <td>75.696418</td>\n",
       "      <td>74.294804</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.56</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.55</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>4.5627</td>\n",
       "      <td>2108361.85</td>\n",
       "      <td>2299718.224</td>\n",
       "      <td>95.789474</td>\n",
       "      <td>82.203580</td>\n",
       "      <td>77.903750</td>\n",
       "      <td>90.803238</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5455</td>\n",
       "      <td>1035909.80</td>\n",
       "      <td>1141853.833</td>\n",
       "      <td>79.381443</td>\n",
       "      <td>81.251865</td>\n",
       "      <td>79.032842</td>\n",
       "      <td>85.689910</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.07</td>\n",
       "      <td>10.77</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.94</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5484</td>\n",
       "      <td>826631.10</td>\n",
       "      <td>904847.854</td>\n",
       "      <td>85.567010</td>\n",
       "      <td>82.701419</td>\n",
       "      <td>80.265199</td>\n",
       "      <td>87.573858</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-30</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.18</td>\n",
       "      <td>10.86</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4545</td>\n",
       "      <td>712001.01</td>\n",
       "      <td>785204.571</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>80.121020</td>\n",
       "      <td>80.216891</td>\n",
       "      <td>79.929279</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.98</td>\n",
       "      <td>11.20</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.10</td>\n",
       "      <td>10.95</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.3699</td>\n",
       "      <td>831622.75</td>\n",
       "      <td>922602.874</td>\n",
       "      <td>89.361702</td>\n",
       "      <td>83.211835</td>\n",
       "      <td>81.218637</td>\n",
       "      <td>87.198231</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-01</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.25</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.9009</td>\n",
       "      <td>1014270.07</td>\n",
       "      <td>1127216.186</td>\n",
       "      <td>94.949495</td>\n",
       "      <td>87.133344</td>\n",
       "      <td>83.194719</td>\n",
       "      <td>95.010594</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.21</td>\n",
       "      <td>10.97</td>\n",
       "      <td>11.21</td>\n",
       "      <td>11.20</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0893</td>\n",
       "      <td>801936.63</td>\n",
       "      <td>889951.528</td>\n",
       "      <td>95.833333</td>\n",
       "      <td>90.037762</td>\n",
       "      <td>85.479211</td>\n",
       "      <td>99.154864</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-12</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.31</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.21</td>\n",
       "      <td>-0.02</td>\n",
       "      <td>-0.1784</td>\n",
       "      <td>959936.90</td>\n",
       "      <td>1071873.084</td>\n",
       "      <td>87.234043</td>\n",
       "      <td>89.102239</td>\n",
       "      <td>86.688114</td>\n",
       "      <td>93.930490</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.12</td>\n",
       "      <td>11.38</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.19</td>\n",
       "      <td>1.6979</td>\n",
       "      <td>1137365.74</td>\n",
       "      <td>1280182.096</td>\n",
       "      <td>96.511628</td>\n",
       "      <td>91.573708</td>\n",
       "      <td>88.317748</td>\n",
       "      <td>98.085627</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.30</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.25</td>\n",
       "      <td>11.38</td>\n",
       "      <td>-0.13</td>\n",
       "      <td>-1.1424</td>\n",
       "      <td>869185.19</td>\n",
       "      <td>977818.097</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>86.046645</td>\n",
       "      <td>87.560372</td>\n",
       "      <td>83.019192</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.23</td>\n",
       "      <td>11.23</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.25</td>\n",
       "      <td>-0.30</td>\n",
       "      <td>-2.6667</td>\n",
       "      <td>1100127.46</td>\n",
       "      <td>1213914.428</td>\n",
       "      <td>28.125000</td>\n",
       "      <td>66.733622</td>\n",
       "      <td>80.616034</td>\n",
       "      <td>38.968799</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.36</td>\n",
       "      <td>10.95</td>\n",
       "      <td>0.41</td>\n",
       "      <td>3.7443</td>\n",
       "      <td>1255522.21</td>\n",
       "      <td>1408279.680</td>\n",
       "      <td>90.909091</td>\n",
       "      <td>74.793728</td>\n",
       "      <td>78.674876</td>\n",
       "      <td>67.031431</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.62</td>\n",
       "      <td>11.24</td>\n",
       "      <td>11.27</td>\n",
       "      <td>11.36</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.7923</td>\n",
       "      <td>1270882.04</td>\n",
       "      <td>1445281.382</td>\n",
       "      <td>51.388889</td>\n",
       "      <td>66.991072</td>\n",
       "      <td>74.779754</td>\n",
       "      <td>51.413708</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.25</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.27</td>\n",
       "      <td>0.14</td>\n",
       "      <td>1.2422</td>\n",
       "      <td>832629.87</td>\n",
       "      <td>949430.819</td>\n",
       "      <td>70.833333</td>\n",
       "      <td>68.271940</td>\n",
       "      <td>72.610289</td>\n",
       "      <td>59.595241</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.38</td>\n",
       "      <td>11.55</td>\n",
       "      <td>11.28</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.41</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4382</td>\n",
       "      <td>754246.48</td>\n",
       "      <td>860591.070</td>\n",
       "      <td>63.888889</td>\n",
       "      <td>66.810836</td>\n",
       "      <td>70.677023</td>\n",
       "      <td>59.078461</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.35</td>\n",
       "      <td>11.57</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.54</td>\n",
       "      <td>11.36</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.5845</td>\n",
       "      <td>1184047.79</td>\n",
       "      <td>1343020.336</td>\n",
       "      <td>88.888889</td>\n",
       "      <td>74.170478</td>\n",
       "      <td>71.841555</td>\n",
       "      <td>78.828326</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.70</td>\n",
       "      <td>12.64</td>\n",
       "      <td>11.57</td>\n",
       "      <td>12.55</td>\n",
       "      <td>11.54</td>\n",
       "      <td>1.01</td>\n",
       "      <td>8.7522</td>\n",
       "      <td>2824935.02</td>\n",
       "      <td>3415946.860</td>\n",
       "      <td>94.827586</td>\n",
       "      <td>81.056363</td>\n",
       "      <td>74.913238</td>\n",
       "      <td>93.342612</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-26</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.55</td>\n",
       "      <td>12.57</td>\n",
       "      <td>12.15</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.55</td>\n",
       "      <td>-0.35</td>\n",
       "      <td>-2.7888</td>\n",
       "      <td>2017544.93</td>\n",
       "      <td>2485673.356</td>\n",
       "      <td>74.712644</td>\n",
       "      <td>78.941753</td>\n",
       "      <td>76.256100</td>\n",
       "      <td>84.313058</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-27</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.24</td>\n",
       "      <td>12.66</td>\n",
       "      <td>12.15</td>\n",
       "      <td>12.40</td>\n",
       "      <td>12.20</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.6393</td>\n",
       "      <td>1979013.88</td>\n",
       "      <td>2454404.411</td>\n",
       "      <td>85.227273</td>\n",
       "      <td>81.036951</td>\n",
       "      <td>77.849736</td>\n",
       "      <td>87.411380</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.44</td>\n",
       "      <td>12.61</td>\n",
       "      <td>12.27</td>\n",
       "      <td>12.36</td>\n",
       "      <td>12.40</td>\n",
       "      <td>-0.04</td>\n",
       "      <td>-0.3226</td>\n",
       "      <td>1113099.80</td>\n",
       "      <td>1383110.810</td>\n",
       "      <td>81.481481</td>\n",
       "      <td>81.185129</td>\n",
       "      <td>78.961542</td>\n",
       "      <td>85.632302</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-01</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.36</td>\n",
       "      <td>0.40</td>\n",
       "      <td>3.2362</td>\n",
       "      <td>1712679.16</td>\n",
       "      <td>2137669.556</td>\n",
       "      <td>98.773006</td>\n",
       "      <td>87.047785</td>\n",
       "      <td>81.656970</td>\n",
       "      <td>97.829414</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.88</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.72</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.88</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>-0.7764</td>\n",
       "      <td>528716.14</td>\n",
       "      <td>676604.872</td>\n",
       "      <td>27.710843</td>\n",
       "      <td>40.903345</td>\n",
       "      <td>46.958157</td>\n",
       "      <td>28.793722</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-09</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.88</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.72</td>\n",
       "      <td>12.74</td>\n",
       "      <td>12.78</td>\n",
       "      <td>-0.04</td>\n",
       "      <td>-0.3130</td>\n",
       "      <td>408553.77</td>\n",
       "      <td>522027.888</td>\n",
       "      <td>22.891566</td>\n",
       "      <td>34.899419</td>\n",
       "      <td>42.938578</td>\n",
       "      <td>18.821102</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-10</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.98</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.74</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.3925</td>\n",
       "      <td>666674.95</td>\n",
       "      <td>853689.950</td>\n",
       "      <td>41.379310</td>\n",
       "      <td>37.059383</td>\n",
       "      <td>40.978846</td>\n",
       "      <td>29.220456</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.67</td>\n",
       "      <td>12.71</td>\n",
       "      <td>12.47</td>\n",
       "      <td>12.59</td>\n",
       "      <td>12.79</td>\n",
       "      <td>-0.20</td>\n",
       "      <td>-1.5637</td>\n",
       "      <td>446214.40</td>\n",
       "      <td>562008.050</td>\n",
       "      <td>18.181818</td>\n",
       "      <td>30.766861</td>\n",
       "      <td>37.574851</td>\n",
       "      <td>17.150882</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.57</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.59</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2.1446</td>\n",
       "      <td>686086.87</td>\n",
       "      <td>874856.562</td>\n",
       "      <td>59.090909</td>\n",
       "      <td>40.208211</td>\n",
       "      <td>38.452638</td>\n",
       "      <td>43.719356</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.93</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.87</td>\n",
       "      <td>12.86</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0778</td>\n",
       "      <td>656396.40</td>\n",
       "      <td>843649.273</td>\n",
       "      <td>78.431373</td>\n",
       "      <td>52.949265</td>\n",
       "      <td>43.284847</td>\n",
       "      <td>72.278100</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.68</td>\n",
       "      <td>12.87</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-1.4763</td>\n",
       "      <td>789154.98</td>\n",
       "      <td>997623.816</td>\n",
       "      <td>41.176471</td>\n",
       "      <td>49.025000</td>\n",
       "      <td>45.198231</td>\n",
       "      <td>56.678538</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.77</td>\n",
       "      <td>13.04</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.68</td>\n",
       "      <td>0.21</td>\n",
       "      <td>1.6562</td>\n",
       "      <td>1331164.77</td>\n",
       "      <td>1713215.766</td>\n",
       "      <td>73.684211</td>\n",
       "      <td>57.244737</td>\n",
       "      <td>49.213733</td>\n",
       "      <td>73.306744</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.86</td>\n",
       "      <td>13.05</td>\n",
       "      <td>12.77</td>\n",
       "      <td>12.99</td>\n",
       "      <td>12.89</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.7758</td>\n",
       "      <td>818455.83</td>\n",
       "      <td>1058524.019</td>\n",
       "      <td>89.655172</td>\n",
       "      <td>68.048215</td>\n",
       "      <td>55.491894</td>\n",
       "      <td>93.160859</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.70</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.45</td>\n",
       "      <td>12.99</td>\n",
       "      <td>0.46</td>\n",
       "      <td>3.5412</td>\n",
       "      <td>2122448.34</td>\n",
       "      <td>2861879.086</td>\n",
       "      <td>79.674797</td>\n",
       "      <td>71.923742</td>\n",
       "      <td>60.969177</td>\n",
       "      <td>93.832874</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.37</td>\n",
       "      <td>13.42</td>\n",
       "      <td>13.16</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.45</td>\n",
       "      <td>-0.22</td>\n",
       "      <td>-1.6357</td>\n",
       "      <td>1032802.74</td>\n",
       "      <td>1368222.854</td>\n",
       "      <td>61.788618</td>\n",
       "      <td>68.545368</td>\n",
       "      <td>63.494574</td>\n",
       "      <td>78.646956</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.31</td>\n",
       "      <td>13.11</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.23</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>646989.63</td>\n",
       "      <td>855052.110</td>\n",
       "      <td>61.788618</td>\n",
       "      <td>66.293118</td>\n",
       "      <td>64.427422</td>\n",
       "      <td>70.024510</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.17</td>\n",
       "      <td>13.28</td>\n",
       "      <td>13.11</td>\n",
       "      <td>13.24</td>\n",
       "      <td>13.23</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0756</td>\n",
       "      <td>566001.61</td>\n",
       "      <td>747473.770</td>\n",
       "      <td>60.344828</td>\n",
       "      <td>64.310354</td>\n",
       "      <td>64.388399</td>\n",
       "      <td>64.154265</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-27</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.64</td>\n",
       "      <td>13.25</td>\n",
       "      <td>13.50</td>\n",
       "      <td>13.24</td>\n",
       "      <td>0.26</td>\n",
       "      <td>1.9637</td>\n",
       "      <td>936829.90</td>\n",
       "      <td>1263809.737</td>\n",
       "      <td>82.758621</td>\n",
       "      <td>70.459776</td>\n",
       "      <td>66.412192</td>\n",
       "      <td>78.554946</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.56</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.50</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.1481</td>\n",
       "      <td>771564.17</td>\n",
       "      <td>1038718.080</td>\n",
       "      <td>84.482759</td>\n",
       "      <td>75.134104</td>\n",
       "      <td>69.319496</td>\n",
       "      <td>86.763320</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.48</td>\n",
       "      <td>14.10</td>\n",
       "      <td>13.45</td>\n",
       "      <td>14.02</td>\n",
       "      <td>13.52</td>\n",
       "      <td>0.50</td>\n",
       "      <td>3.6982</td>\n",
       "      <td>1108722.39</td>\n",
       "      <td>1541638.203</td>\n",
       "      <td>94.482759</td>\n",
       "      <td>81.583655</td>\n",
       "      <td>73.407549</td>\n",
       "      <td>97.935868</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-30</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>14.02</td>\n",
       "      <td>14.32</td>\n",
       "      <td>13.88</td>\n",
       "      <td>13.93</td>\n",
       "      <td>14.02</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.6419</td>\n",
       "      <td>819540.43</td>\n",
       "      <td>1155968.238</td>\n",
       "      <td>74.838710</td>\n",
       "      <td>79.335340</td>\n",
       "      <td>75.383479</td>\n",
       "      <td>87.239062</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-06</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.89</td>\n",
       "      <td>13.61</td>\n",
       "      <td>13.77</td>\n",
       "      <td>13.93</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.1486</td>\n",
       "      <td>1008998.02</td>\n",
       "      <td>1382727.481</td>\n",
       "      <td>54.545455</td>\n",
       "      <td>71.072045</td>\n",
       "      <td>73.946335</td>\n",
       "      <td>65.323466</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.60</td>\n",
       "      <td>13.69</td>\n",
       "      <td>13.77</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.5810</td>\n",
       "      <td>662749.23</td>\n",
       "      <td>904349.531</td>\n",
       "      <td>47.933884</td>\n",
       "      <td>63.359325</td>\n",
       "      <td>70.417331</td>\n",
       "      <td>49.243312</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>14.02</td>\n",
       "      <td>13.68</td>\n",
       "      <td>13.95</td>\n",
       "      <td>13.69</td>\n",
       "      <td>0.26</td>\n",
       "      <td>1.8992</td>\n",
       "      <td>934781.70</td>\n",
       "      <td>1297924.588</td>\n",
       "      <td>69.421488</td>\n",
       "      <td>65.380046</td>\n",
       "      <td>68.738236</td>\n",
       "      <td>58.663665</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.92</td>\n",
       "      <td>14.13</td>\n",
       "      <td>13.90</td>\n",
       "      <td>14.00</td>\n",
       "      <td>13.95</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.3584</td>\n",
       "      <td>612862.29</td>\n",
       "      <td>859156.594</td>\n",
       "      <td>73.553719</td>\n",
       "      <td>68.104603</td>\n",
       "      <td>68.527025</td>\n",
       "      <td>67.259760</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-12</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.95</td>\n",
       "      <td>14.05</td>\n",
       "      <td>13.72</td>\n",
       "      <td>13.79</td>\n",
       "      <td>14.00</td>\n",
       "      <td>-0.21</td>\n",
       "      <td>-1.5000</td>\n",
       "      <td>558511.14</td>\n",
       "      <td>772109.502</td>\n",
       "      <td>50.467290</td>\n",
       "      <td>62.225499</td>\n",
       "      <td>66.426516</td>\n",
       "      <td>53.823464</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.75</td>\n",
       "      <td>13.78</td>\n",
       "      <td>13.53</td>\n",
       "      <td>13.63</td>\n",
       "      <td>13.79</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.1603</td>\n",
       "      <td>640358.79</td>\n",
       "      <td>871062.043</td>\n",
       "      <td>34.285714</td>\n",
       "      <td>52.912237</td>\n",
       "      <td>61.921757</td>\n",
       "      <td>34.893199</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.55</td>\n",
       "      <td>13.59</td>\n",
       "      <td>13.22</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.63</td>\n",
       "      <td>-0.33</td>\n",
       "      <td>-2.4211</td>\n",
       "      <td>944672.09</td>\n",
       "      <td>1259440.848</td>\n",
       "      <td>7.272727</td>\n",
       "      <td>37.699067</td>\n",
       "      <td>53.847527</td>\n",
       "      <td>5.402148</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.39</td>\n",
       "      <td>13.43</td>\n",
       "      <td>13.14</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.30</td>\n",
       "      <td>-0.07</td>\n",
       "      <td>-0.5263</td>\n",
       "      <td>756794.47</td>\n",
       "      <td>1004313.267</td>\n",
       "      <td>7.627119</td>\n",
       "      <td>27.675084</td>\n",
       "      <td>45.123379</td>\n",
       "      <td>-7.221506</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.34</td>\n",
       "      <td>13.12</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.23</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2268</td>\n",
       "      <td>637208.57</td>\n",
       "      <td>843479.669</td>\n",
       "      <td>7.920792</td>\n",
       "      <td>21.090320</td>\n",
       "      <td>37.112360</td>\n",
       "      <td>-10.953759</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.41</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.20</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.2121</td>\n",
       "      <td>600368.64</td>\n",
       "      <td>801755.671</td>\n",
       "      <td>23.762376</td>\n",
       "      <td>21.981006</td>\n",
       "      <td>32.068575</td>\n",
       "      <td>1.805867</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.38</td>\n",
       "      <td>13.62</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.51</td>\n",
       "      <td>13.36</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.1228</td>\n",
       "      <td>690851.07</td>\n",
       "      <td>929928.885</td>\n",
       "      <td>38.613861</td>\n",
       "      <td>27.525291</td>\n",
       "      <td>30.554147</td>\n",
       "      <td>21.467579</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.57</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.40</td>\n",
       "      <td>13.51</td>\n",
       "      <td>-0.11</td>\n",
       "      <td>-0.8142</td>\n",
       "      <td>552312.00</td>\n",
       "      <td>742797.057</td>\n",
       "      <td>27.722772</td>\n",
       "      <td>27.591118</td>\n",
       "      <td>29.566471</td>\n",
       "      <td>23.640413</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.40</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.5821</td>\n",
       "      <td>856237.33</td>\n",
       "      <td>1119433.491</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>18.394079</td>\n",
       "      <td>25.842340</td>\n",
       "      <td>3.497556</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>328 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2019-01-14  000001.SZ  10.22  10.25  10.07  10.11      10.20   -0.09  -0.8824   \n",
       "2019-01-15  000001.SZ  10.11  10.28  10.09  10.24      10.11    0.13   1.2859   \n",
       "2019-01-16  000001.SZ  10.24  10.50  10.23  10.48      10.24    0.24   2.3438   \n",
       "2019-01-17  000001.SZ  10.54  10.57  10.17  10.25      10.48   -0.23  -2.1947   \n",
       "2019-01-18  000001.SZ  10.34  10.49  10.28  10.43      10.25    0.18   1.7561   \n",
       "2019-01-21  000001.SZ  10.34  10.47  10.32  10.34      10.43   -0.09  -0.8629   \n",
       "2019-01-22  000001.SZ  10.34  10.44  10.26  10.28      10.34   -0.06  -0.5803   \n",
       "2019-01-23  000001.SZ  10.29  10.47  10.29  10.35      10.28    0.07   0.6809   \n",
       "2019-01-24  000001.SZ  10.40  10.55  10.37  10.52      10.35    0.17   1.6425   \n",
       "2019-01-25  000001.SZ  10.56  11.04  10.55  11.00      10.52    0.48   4.5627   \n",
       "2019-01-28  000001.SZ  11.04  11.14  10.88  10.94      11.00   -0.06  -0.5455   \n",
       "2019-01-29  000001.SZ  10.96  11.07  10.77  11.00      10.94    0.06   0.5484   \n",
       "2019-01-30  000001.SZ  10.95  11.18  10.86  10.95      11.00   -0.05  -0.4545   \n",
       "2019-01-31  000001.SZ  10.98  11.20  10.94  11.10      10.95    0.15   1.3699   \n",
       "2019-02-01  000001.SZ  11.20  11.25  10.96  11.20      11.10    0.10   0.9009   \n",
       "2019-02-11  000001.SZ  11.08  11.21  10.97  11.21      11.20    0.01   0.0893   \n",
       "2019-02-12  000001.SZ  11.20  11.31  11.03  11.19      11.21   -0.02  -0.1784   \n",
       "2019-02-13  000001.SZ  11.19  11.41  11.12  11.38      11.19    0.19   1.6979   \n",
       "2019-02-14  000001.SZ  11.30  11.33  11.19  11.25      11.38   -0.13  -1.1424   \n",
       "2019-02-15  000001.SZ  11.23  11.23  10.90  10.95      11.25   -0.30  -2.6667   \n",
       "2019-02-18  000001.SZ  11.05  11.36  11.04  11.36      10.95    0.41   3.7443   \n",
       "2019-02-19  000001.SZ  11.36  11.62  11.24  11.27      11.36   -0.09  -0.7923   \n",
       "2019-02-20  000001.SZ  11.33  11.53  11.25  11.41      11.27    0.14   1.2422   \n",
       "2019-02-21  000001.SZ  11.38  11.55  11.28  11.36      11.41   -0.05  -0.4382   \n",
       "2019-02-22  000001.SZ  11.35  11.57  11.15  11.54      11.36    0.18   1.5845   \n",
       "2019-02-25  000001.SZ  11.70  12.64  11.57  12.55      11.54    1.01   8.7522   \n",
       "2019-02-26  000001.SZ  12.55  12.57  12.15  12.20      12.55   -0.35  -2.7888   \n",
       "2019-02-27  000001.SZ  12.24  12.66  12.15  12.40      12.20    0.20   1.6393   \n",
       "2019-02-28  000001.SZ  12.44  12.61  12.27  12.36      12.40   -0.04  -0.3226   \n",
       "2019-03-01  000001.SZ  12.48  12.78  12.20  12.76      12.36    0.40   3.2362   \n",
       "...               ...    ...    ...    ...    ...        ...     ...      ...   \n",
       "2020-04-08  000001.SZ  12.88  12.92  12.72  12.78      12.88   -0.10  -0.7764   \n",
       "2020-04-09  000001.SZ  12.88  12.89  12.72  12.74      12.78   -0.04  -0.3130   \n",
       "2020-04-10  000001.SZ  12.76  12.98  12.65  12.79      12.74    0.05   0.3925   \n",
       "2020-04-13  000001.SZ  12.67  12.71  12.47  12.59      12.79   -0.20  -1.5637   \n",
       "2020-04-14  000001.SZ  12.65  12.86  12.57  12.86      12.59    0.27   2.1446   \n",
       "2020-04-15  000001.SZ  12.86  12.93  12.78  12.87      12.86    0.01   0.0778   \n",
       "2020-04-16  000001.SZ  12.79  12.79  12.54  12.68      12.87   -0.19  -1.4763   \n",
       "2020-04-17  000001.SZ  12.77  13.04  12.65  12.89      12.68    0.21   1.6562   \n",
       "2020-04-20  000001.SZ  12.86  13.05  12.77  12.99      12.89    0.10   0.7758   \n",
       "2020-04-21  000001.SZ  13.30  13.70  13.30  13.45      12.99    0.46   3.5412   \n",
       "2020-04-22  000001.SZ  13.37  13.42  13.16  13.23      13.45   -0.22  -1.6357   \n",
       "2020-04-23  000001.SZ  13.23  13.31  13.11  13.23      13.23    0.00   0.0000   \n",
       "2020-04-24  000001.SZ  13.17  13.28  13.11  13.24      13.23    0.01   0.0756   \n",
       "2020-04-27  000001.SZ  13.30  13.64  13.25  13.50      13.24    0.26   1.9637   \n",
       "2020-04-28  000001.SZ  13.45  13.56  13.27  13.52      13.50    0.02   0.1481   \n",
       "2020-04-29  000001.SZ  13.48  14.10  13.45  14.02      13.52    0.50   3.6982   \n",
       "2020-04-30  000001.SZ  14.02  14.32  13.88  13.93      14.02   -0.09  -0.6419   \n",
       "2020-05-06  000001.SZ  13.76  13.89  13.61  13.77      13.93   -0.16  -1.1486   \n",
       "2020-05-07  000001.SZ  13.76  13.76  13.60  13.69      13.77   -0.08  -0.5810   \n",
       "2020-05-08  000001.SZ  13.76  14.02  13.68  13.95      13.69    0.26   1.8992   \n",
       "2020-05-11  000001.SZ  13.92  14.13  13.90  14.00      13.95    0.05   0.3584   \n",
       "2020-05-12  000001.SZ  13.95  14.05  13.72  13.79      14.00   -0.21  -1.5000   \n",
       "2020-05-13  000001.SZ  13.75  13.78  13.53  13.63      13.79   -0.16  -1.1603   \n",
       "2020-05-14  000001.SZ  13.55  13.59  13.22  13.30      13.63   -0.33  -2.4211   \n",
       "2020-05-15  000001.SZ  13.39  13.43  13.14  13.23      13.30   -0.07  -0.5263   \n",
       "2020-05-18  000001.SZ  13.20  13.34  13.12  13.20      13.23   -0.03  -0.2268   \n",
       "2020-05-19  000001.SZ  13.41  13.45  13.27  13.36      13.20    0.16   1.2121   \n",
       "2020-05-20  000001.SZ  13.38  13.62  13.27  13.51      13.36    0.15   1.1228   \n",
       "2020-05-21  000001.SZ  13.52  13.57  13.36  13.40      13.51   -0.11  -0.8142   \n",
       "2020-05-22  000001.SZ  13.33  13.34  12.92  12.92      13.40   -0.48  -3.5821   \n",
       "\n",
       "                   vol       amount        RSV          K          D  \\\n",
       "trade_date                                                             \n",
       "2019-01-14   500443.59   507862.882  87.272727  87.272727  87.272727   \n",
       "2019-01-15   542160.55   553027.309  96.460177  92.785197  90.580209   \n",
       "2019-01-16   977699.37  1017495.116  98.437500  95.462604  92.892922   \n",
       "2019-01-17   882811.92   910212.066  66.315789  83.355466  88.931210   \n",
       "2019-01-18   738793.26   769973.637  85.263158  84.087802  87.071892   \n",
       "2019-01-21   659355.76   684465.646  73.563218  80.241977  84.576149   \n",
       "2019-01-22   424413.57   438991.450  59.154930  72.775995  80.398241   \n",
       "2019-01-23   537876.63   559384.396  57.692308  67.543953  75.939505   \n",
       "2019-01-24   679240.88   711495.718  90.000000  75.229213  75.696418   \n",
       "2019-01-25  2108361.85  2299718.224  95.789474  82.203580  77.903750   \n",
       "2019-01-28  1035909.80  1141853.833  79.381443  81.251865  79.032842   \n",
       "2019-01-29   826631.10   904847.854  85.567010  82.701419  80.265199   \n",
       "2019-01-30   712001.01   785204.571  75.000000  80.121020  80.216891   \n",
       "2019-01-31   831622.75   922602.874  89.361702  83.211835  81.218637   \n",
       "2019-02-01  1014270.07  1127216.186  94.949495  87.133344  83.194719   \n",
       "2019-02-11   801936.63   889951.528  95.833333  90.037762  85.479211   \n",
       "2019-02-12   959936.90  1071873.084  87.234043  89.102239  86.688114   \n",
       "2019-02-13  1137365.74  1280182.096  96.511628  91.573708  88.317748   \n",
       "2019-02-14   869185.19   977818.097  75.000000  86.046645  87.560372   \n",
       "2019-02-15  1100127.46  1213914.428  28.125000  66.733622  80.616034   \n",
       "2019-02-18  1255522.21  1408279.680  90.909091  74.793728  78.674876   \n",
       "2019-02-19  1270882.04  1445281.382  51.388889  66.991072  74.779754   \n",
       "2019-02-20   832629.87   949430.819  70.833333  68.271940  72.610289   \n",
       "2019-02-21   754246.48   860591.070  63.888889  66.810836  70.677023   \n",
       "2019-02-22  1184047.79  1343020.336  88.888889  74.170478  71.841555   \n",
       "2019-02-25  2824935.02  3415946.860  94.827586  81.056363  74.913238   \n",
       "2019-02-26  2017544.93  2485673.356  74.712644  78.941753  76.256100   \n",
       "2019-02-27  1979013.88  2454404.411  85.227273  81.036951  77.849736   \n",
       "2019-02-28  1113099.80  1383110.810  81.481481  81.185129  78.961542   \n",
       "2019-03-01  1712679.16  2137669.556  98.773006  87.047785  81.656970   \n",
       "...                ...          ...        ...        ...        ...   \n",
       "2020-04-08   528716.14   676604.872  27.710843  40.903345  46.958157   \n",
       "2020-04-09   408553.77   522027.888  22.891566  34.899419  42.938578   \n",
       "2020-04-10   666674.95   853689.950  41.379310  37.059383  40.978846   \n",
       "2020-04-13   446214.40   562008.050  18.181818  30.766861  37.574851   \n",
       "2020-04-14   686086.87   874856.562  59.090909  40.208211  38.452638   \n",
       "2020-04-15   656396.40   843649.273  78.431373  52.949265  43.284847   \n",
       "2020-04-16   789154.98   997623.816  41.176471  49.025000  45.198231   \n",
       "2020-04-17  1331164.77  1713215.766  73.684211  57.244737  49.213733   \n",
       "2020-04-20   818455.83  1058524.019  89.655172  68.048215  55.491894   \n",
       "2020-04-21  2122448.34  2861879.086  79.674797  71.923742  60.969177   \n",
       "2020-04-22  1032802.74  1368222.854  61.788618  68.545368  63.494574   \n",
       "2020-04-23   646989.63   855052.110  61.788618  66.293118  64.427422   \n",
       "2020-04-24   566001.61   747473.770  60.344828  64.310354  64.388399   \n",
       "2020-04-27   936829.90  1263809.737  82.758621  70.459776  66.412192   \n",
       "2020-04-28   771564.17  1038718.080  84.482759  75.134104  69.319496   \n",
       "2020-04-29  1108722.39  1541638.203  94.482759  81.583655  73.407549   \n",
       "2020-04-30   819540.43  1155968.238  74.838710  79.335340  75.383479   \n",
       "2020-05-06  1008998.02  1382727.481  54.545455  71.072045  73.946335   \n",
       "2020-05-07   662749.23   904349.531  47.933884  63.359325  70.417331   \n",
       "2020-05-08   934781.70  1297924.588  69.421488  65.380046  68.738236   \n",
       "2020-05-11   612862.29   859156.594  73.553719  68.104603  68.527025   \n",
       "2020-05-12   558511.14   772109.502  50.467290  62.225499  66.426516   \n",
       "2020-05-13   640358.79   871062.043  34.285714  52.912237  61.921757   \n",
       "2020-05-14   944672.09  1259440.848   7.272727  37.699067  53.847527   \n",
       "2020-05-15   756794.47  1004313.267   7.627119  27.675084  45.123379   \n",
       "2020-05-18   637208.57   843479.669   7.920792  21.090320  37.112360   \n",
       "2020-05-19   600368.64   801755.671  23.762376  21.981006  32.068575   \n",
       "2020-05-20   690851.07   929928.885  38.613861  27.525291  30.554147   \n",
       "2020-05-21   552312.00   742797.057  27.722772  27.591118  29.566471   \n",
       "2020-05-22   856237.33  1119433.491   0.000000  18.394079  25.842340   \n",
       "\n",
       "                     J KDJ金叉死叉  \n",
       "trade_date                      \n",
       "2019-01-14   87.272727          \n",
       "2019-01-15   97.195173          \n",
       "2019-01-16  100.601966          \n",
       "2019-01-17   72.203977          \n",
       "2019-01-18   78.119623          \n",
       "2019-01-21   71.573634          \n",
       "2019-01-22   57.531502          \n",
       "2019-01-23   50.752848          \n",
       "2019-01-24   74.294804          \n",
       "2019-01-25   90.803238          \n",
       "2019-01-28   85.689910          \n",
       "2019-01-29   87.573858          \n",
       "2019-01-30   79.929279          \n",
       "2019-01-31   87.198231          \n",
       "2019-02-01   95.010594          \n",
       "2019-02-11   99.154864          \n",
       "2019-02-12   93.930490          \n",
       "2019-02-13   98.085627          \n",
       "2019-02-14   83.019192          \n",
       "2019-02-15   38.968799          \n",
       "2019-02-18   67.031431          \n",
       "2019-02-19   51.413708          \n",
       "2019-02-20   59.595241          \n",
       "2019-02-21   59.078461          \n",
       "2019-02-22   78.828326          \n",
       "2019-02-25   93.342612          \n",
       "2019-02-26   84.313058          \n",
       "2019-02-27   87.411380          \n",
       "2019-02-28   85.632302          \n",
       "2019-03-01   97.829414          \n",
       "...                ...     ...  \n",
       "2020-04-08   28.793722          \n",
       "2020-04-09   18.821102          \n",
       "2020-04-10   29.220456          \n",
       "2020-04-13   17.150882          \n",
       "2020-04-14   43.719356          \n",
       "2020-04-15   72.278100          \n",
       "2020-04-16   56.678538          \n",
       "2020-04-17   73.306744          \n",
       "2020-04-20   93.160859          \n",
       "2020-04-21   93.832874          \n",
       "2020-04-22   78.646956          \n",
       "2020-04-23   70.024510          \n",
       "2020-04-24   64.154265          \n",
       "2020-04-27   78.554946          \n",
       "2020-04-28   86.763320          \n",
       "2020-04-29   97.935868          \n",
       "2020-04-30   87.239062          \n",
       "2020-05-06   65.323466          \n",
       "2020-05-07   49.243312          \n",
       "2020-05-08   58.663665          \n",
       "2020-05-11   67.259760          \n",
       "2020-05-12   53.823464          \n",
       "2020-05-13   34.893199          \n",
       "2020-05-14    5.402148          \n",
       "2020-05-15   -7.221506          \n",
       "2020-05-18  -10.953759          \n",
       "2020-05-19    1.805867          \n",
       "2020-05-20   21.467579          \n",
       "2020-05-21   23.640413          \n",
       "2020-05-22    3.497556          \n",
       "\n",
       "[328 rows x 15 columns]"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对K与D做判断"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如何自动化找关键点："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "KDJ_Cross_Bool = df_whole['K'] > df_whole['D']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "trade_date\n",
       "2019-01-14    False\n",
       "2019-01-15     True\n",
       "2019-01-16     True\n",
       "2019-01-17    False\n",
       "2019-01-18    False\n",
       "2019-01-21    False\n",
       "2019-01-22    False\n",
       "2019-01-23    False\n",
       "2019-01-24    False\n",
       "2019-01-25     True\n",
       "2019-01-28     True\n",
       "2019-01-29     True\n",
       "2019-01-30    False\n",
       "2019-01-31     True\n",
       "2019-02-01     True\n",
       "2019-02-11     True\n",
       "2019-02-12     True\n",
       "2019-02-13     True\n",
       "2019-02-14    False\n",
       "2019-02-15    False\n",
       "2019-02-18    False\n",
       "2019-02-19    False\n",
       "2019-02-20    False\n",
       "2019-02-21    False\n",
       "2019-02-22     True\n",
       "2019-02-25     True\n",
       "2019-02-26     True\n",
       "2019-02-27     True\n",
       "2019-02-28     True\n",
       "2019-03-01     True\n",
       "              ...  \n",
       "2020-04-08    False\n",
       "2020-04-09    False\n",
       "2020-04-10    False\n",
       "2020-04-13    False\n",
       "2020-04-14     True\n",
       "2020-04-15     True\n",
       "2020-04-16     True\n",
       "2020-04-17     True\n",
       "2020-04-20     True\n",
       "2020-04-21     True\n",
       "2020-04-22     True\n",
       "2020-04-23     True\n",
       "2020-04-24    False\n",
       "2020-04-27     True\n",
       "2020-04-28     True\n",
       "2020-04-29     True\n",
       "2020-04-30     True\n",
       "2020-05-06    False\n",
       "2020-05-07    False\n",
       "2020-05-08    False\n",
       "2020-05-11    False\n",
       "2020-05-12    False\n",
       "2020-05-13    False\n",
       "2020-05-14    False\n",
       "2020-05-15    False\n",
       "2020-05-18    False\n",
       "2020-05-19    False\n",
       "2020-05-20    False\n",
       "2020-05-21    False\n",
       "2020-05-22    False\n",
       "Length: 328, dtype: bool"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "KDJ_Cross_Bool"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "KDJ_Cross_Bool_Tomorrow = KDJ_Cross_Bool.shift()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole.loc[KDJ_Cross_Bool[(KDJ_Cross_Bool ==True)&(KDJ_Cross_Bool_Tomorrow ==False)].index,'KDJ金叉死叉'] = '金叉' "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>RSV</th>\n",
       "      <th>K</th>\n",
       "      <th>D</th>\n",
       "      <th>J</th>\n",
       "      <th>KDJ金叉死叉</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.07</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.20</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8824</td>\n",
       "      <td>500443.59</td>\n",
       "      <td>507862.882</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.11</td>\n",
       "      <td>0.13</td>\n",
       "      <td>1.2859</td>\n",
       "      <td>542160.55</td>\n",
       "      <td>553027.309</td>\n",
       "      <td>96.460177</td>\n",
       "      <td>92.785197</td>\n",
       "      <td>90.580209</td>\n",
       "      <td>97.195173</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.23</td>\n",
       "      <td>10.48</td>\n",
       "      <td>10.24</td>\n",
       "      <td>0.24</td>\n",
       "      <td>2.3438</td>\n",
       "      <td>977699.37</td>\n",
       "      <td>1017495.116</td>\n",
       "      <td>98.437500</td>\n",
       "      <td>95.462604</td>\n",
       "      <td>92.892922</td>\n",
       "      <td>100.601966</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.57</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.48</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.1947</td>\n",
       "      <td>882811.92</td>\n",
       "      <td>910212.066</td>\n",
       "      <td>66.315789</td>\n",
       "      <td>83.355466</td>\n",
       "      <td>88.931210</td>\n",
       "      <td>72.203977</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.49</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.43</td>\n",
       "      <td>10.25</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.7561</td>\n",
       "      <td>738793.26</td>\n",
       "      <td>769973.637</td>\n",
       "      <td>85.263158</td>\n",
       "      <td>84.087802</td>\n",
       "      <td>87.071892</td>\n",
       "      <td>78.119623</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.32</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.43</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8629</td>\n",
       "      <td>659355.76</td>\n",
       "      <td>684465.646</td>\n",
       "      <td>73.563218</td>\n",
       "      <td>80.241977</td>\n",
       "      <td>84.576149</td>\n",
       "      <td>71.573634</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.44</td>\n",
       "      <td>10.26</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.34</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5803</td>\n",
       "      <td>424413.57</td>\n",
       "      <td>438991.450</td>\n",
       "      <td>59.154930</td>\n",
       "      <td>72.775995</td>\n",
       "      <td>80.398241</td>\n",
       "      <td>57.531502</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.35</td>\n",
       "      <td>10.28</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.6809</td>\n",
       "      <td>537876.63</td>\n",
       "      <td>559384.396</td>\n",
       "      <td>57.692308</td>\n",
       "      <td>67.543953</td>\n",
       "      <td>75.939505</td>\n",
       "      <td>50.752848</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.40</td>\n",
       "      <td>10.55</td>\n",
       "      <td>10.37</td>\n",
       "      <td>10.52</td>\n",
       "      <td>10.35</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.6425</td>\n",
       "      <td>679240.88</td>\n",
       "      <td>711495.718</td>\n",
       "      <td>90.000000</td>\n",
       "      <td>75.229213</td>\n",
       "      <td>75.696418</td>\n",
       "      <td>74.294804</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.56</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.55</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>4.5627</td>\n",
       "      <td>2108361.85</td>\n",
       "      <td>2299718.224</td>\n",
       "      <td>95.789474</td>\n",
       "      <td>82.203580</td>\n",
       "      <td>77.903750</td>\n",
       "      <td>90.803238</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5455</td>\n",
       "      <td>1035909.80</td>\n",
       "      <td>1141853.833</td>\n",
       "      <td>79.381443</td>\n",
       "      <td>81.251865</td>\n",
       "      <td>79.032842</td>\n",
       "      <td>85.689910</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.07</td>\n",
       "      <td>10.77</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.94</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5484</td>\n",
       "      <td>826631.10</td>\n",
       "      <td>904847.854</td>\n",
       "      <td>85.567010</td>\n",
       "      <td>82.701419</td>\n",
       "      <td>80.265199</td>\n",
       "      <td>87.573858</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-30</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.18</td>\n",
       "      <td>10.86</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4545</td>\n",
       "      <td>712001.01</td>\n",
       "      <td>785204.571</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>80.121020</td>\n",
       "      <td>80.216891</td>\n",
       "      <td>79.929279</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.98</td>\n",
       "      <td>11.20</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.10</td>\n",
       "      <td>10.95</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.3699</td>\n",
       "      <td>831622.75</td>\n",
       "      <td>922602.874</td>\n",
       "      <td>89.361702</td>\n",
       "      <td>83.211835</td>\n",
       "      <td>81.218637</td>\n",
       "      <td>87.198231</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-01</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.25</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.9009</td>\n",
       "      <td>1014270.07</td>\n",
       "      <td>1127216.186</td>\n",
       "      <td>94.949495</td>\n",
       "      <td>87.133344</td>\n",
       "      <td>83.194719</td>\n",
       "      <td>95.010594</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.21</td>\n",
       "      <td>10.97</td>\n",
       "      <td>11.21</td>\n",
       "      <td>11.20</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0893</td>\n",
       "      <td>801936.63</td>\n",
       "      <td>889951.528</td>\n",
       "      <td>95.833333</td>\n",
       "      <td>90.037762</td>\n",
       "      <td>85.479211</td>\n",
       "      <td>99.154864</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-12</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.31</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.21</td>\n",
       "      <td>-0.02</td>\n",
       "      <td>-0.1784</td>\n",
       "      <td>959936.90</td>\n",
       "      <td>1071873.084</td>\n",
       "      <td>87.234043</td>\n",
       "      <td>89.102239</td>\n",
       "      <td>86.688114</td>\n",
       "      <td>93.930490</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.12</td>\n",
       "      <td>11.38</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.19</td>\n",
       "      <td>1.6979</td>\n",
       "      <td>1137365.74</td>\n",
       "      <td>1280182.096</td>\n",
       "      <td>96.511628</td>\n",
       "      <td>91.573708</td>\n",
       "      <td>88.317748</td>\n",
       "      <td>98.085627</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.30</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.25</td>\n",
       "      <td>11.38</td>\n",
       "      <td>-0.13</td>\n",
       "      <td>-1.1424</td>\n",
       "      <td>869185.19</td>\n",
       "      <td>977818.097</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>86.046645</td>\n",
       "      <td>87.560372</td>\n",
       "      <td>83.019192</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.23</td>\n",
       "      <td>11.23</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.25</td>\n",
       "      <td>-0.30</td>\n",
       "      <td>-2.6667</td>\n",
       "      <td>1100127.46</td>\n",
       "      <td>1213914.428</td>\n",
       "      <td>28.125000</td>\n",
       "      <td>66.733622</td>\n",
       "      <td>80.616034</td>\n",
       "      <td>38.968799</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.36</td>\n",
       "      <td>10.95</td>\n",
       "      <td>0.41</td>\n",
       "      <td>3.7443</td>\n",
       "      <td>1255522.21</td>\n",
       "      <td>1408279.680</td>\n",
       "      <td>90.909091</td>\n",
       "      <td>74.793728</td>\n",
       "      <td>78.674876</td>\n",
       "      <td>67.031431</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.62</td>\n",
       "      <td>11.24</td>\n",
       "      <td>11.27</td>\n",
       "      <td>11.36</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.7923</td>\n",
       "      <td>1270882.04</td>\n",
       "      <td>1445281.382</td>\n",
       "      <td>51.388889</td>\n",
       "      <td>66.991072</td>\n",
       "      <td>74.779754</td>\n",
       "      <td>51.413708</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.25</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.27</td>\n",
       "      <td>0.14</td>\n",
       "      <td>1.2422</td>\n",
       "      <td>832629.87</td>\n",
       "      <td>949430.819</td>\n",
       "      <td>70.833333</td>\n",
       "      <td>68.271940</td>\n",
       "      <td>72.610289</td>\n",
       "      <td>59.595241</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.38</td>\n",
       "      <td>11.55</td>\n",
       "      <td>11.28</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.41</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4382</td>\n",
       "      <td>754246.48</td>\n",
       "      <td>860591.070</td>\n",
       "      <td>63.888889</td>\n",
       "      <td>66.810836</td>\n",
       "      <td>70.677023</td>\n",
       "      <td>59.078461</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.35</td>\n",
       "      <td>11.57</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.54</td>\n",
       "      <td>11.36</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.5845</td>\n",
       "      <td>1184047.79</td>\n",
       "      <td>1343020.336</td>\n",
       "      <td>88.888889</td>\n",
       "      <td>74.170478</td>\n",
       "      <td>71.841555</td>\n",
       "      <td>78.828326</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.70</td>\n",
       "      <td>12.64</td>\n",
       "      <td>11.57</td>\n",
       "      <td>12.55</td>\n",
       "      <td>11.54</td>\n",
       "      <td>1.01</td>\n",
       "      <td>8.7522</td>\n",
       "      <td>2824935.02</td>\n",
       "      <td>3415946.860</td>\n",
       "      <td>94.827586</td>\n",
       "      <td>81.056363</td>\n",
       "      <td>74.913238</td>\n",
       "      <td>93.342612</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-26</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.55</td>\n",
       "      <td>12.57</td>\n",
       "      <td>12.15</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.55</td>\n",
       "      <td>-0.35</td>\n",
       "      <td>-2.7888</td>\n",
       "      <td>2017544.93</td>\n",
       "      <td>2485673.356</td>\n",
       "      <td>74.712644</td>\n",
       "      <td>78.941753</td>\n",
       "      <td>76.256100</td>\n",
       "      <td>84.313058</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-27</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.24</td>\n",
       "      <td>12.66</td>\n",
       "      <td>12.15</td>\n",
       "      <td>12.40</td>\n",
       "      <td>12.20</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.6393</td>\n",
       "      <td>1979013.88</td>\n",
       "      <td>2454404.411</td>\n",
       "      <td>85.227273</td>\n",
       "      <td>81.036951</td>\n",
       "      <td>77.849736</td>\n",
       "      <td>87.411380</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.44</td>\n",
       "      <td>12.61</td>\n",
       "      <td>12.27</td>\n",
       "      <td>12.36</td>\n",
       "      <td>12.40</td>\n",
       "      <td>-0.04</td>\n",
       "      <td>-0.3226</td>\n",
       "      <td>1113099.80</td>\n",
       "      <td>1383110.810</td>\n",
       "      <td>81.481481</td>\n",
       "      <td>81.185129</td>\n",
       "      <td>78.961542</td>\n",
       "      <td>85.632302</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-01</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.36</td>\n",
       "      <td>0.40</td>\n",
       "      <td>3.2362</td>\n",
       "      <td>1712679.16</td>\n",
       "      <td>2137669.556</td>\n",
       "      <td>98.773006</td>\n",
       "      <td>87.047785</td>\n",
       "      <td>81.656970</td>\n",
       "      <td>97.829414</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.88</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.72</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.88</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>-0.7764</td>\n",
       "      <td>528716.14</td>\n",
       "      <td>676604.872</td>\n",
       "      <td>27.710843</td>\n",
       "      <td>40.903345</td>\n",
       "      <td>46.958157</td>\n",
       "      <td>28.793722</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-09</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.88</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.72</td>\n",
       "      <td>12.74</td>\n",
       "      <td>12.78</td>\n",
       "      <td>-0.04</td>\n",
       "      <td>-0.3130</td>\n",
       "      <td>408553.77</td>\n",
       "      <td>522027.888</td>\n",
       "      <td>22.891566</td>\n",
       "      <td>34.899419</td>\n",
       "      <td>42.938578</td>\n",
       "      <td>18.821102</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-10</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.98</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.74</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.3925</td>\n",
       "      <td>666674.95</td>\n",
       "      <td>853689.950</td>\n",
       "      <td>41.379310</td>\n",
       "      <td>37.059383</td>\n",
       "      <td>40.978846</td>\n",
       "      <td>29.220456</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.67</td>\n",
       "      <td>12.71</td>\n",
       "      <td>12.47</td>\n",
       "      <td>12.59</td>\n",
       "      <td>12.79</td>\n",
       "      <td>-0.20</td>\n",
       "      <td>-1.5637</td>\n",
       "      <td>446214.40</td>\n",
       "      <td>562008.050</td>\n",
       "      <td>18.181818</td>\n",
       "      <td>30.766861</td>\n",
       "      <td>37.574851</td>\n",
       "      <td>17.150882</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.57</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.59</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2.1446</td>\n",
       "      <td>686086.87</td>\n",
       "      <td>874856.562</td>\n",
       "      <td>59.090909</td>\n",
       "      <td>40.208211</td>\n",
       "      <td>38.452638</td>\n",
       "      <td>43.719356</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.93</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.87</td>\n",
       "      <td>12.86</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0778</td>\n",
       "      <td>656396.40</td>\n",
       "      <td>843649.273</td>\n",
       "      <td>78.431373</td>\n",
       "      <td>52.949265</td>\n",
       "      <td>43.284847</td>\n",
       "      <td>72.278100</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.68</td>\n",
       "      <td>12.87</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-1.4763</td>\n",
       "      <td>789154.98</td>\n",
       "      <td>997623.816</td>\n",
       "      <td>41.176471</td>\n",
       "      <td>49.025000</td>\n",
       "      <td>45.198231</td>\n",
       "      <td>56.678538</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.77</td>\n",
       "      <td>13.04</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.68</td>\n",
       "      <td>0.21</td>\n",
       "      <td>1.6562</td>\n",
       "      <td>1331164.77</td>\n",
       "      <td>1713215.766</td>\n",
       "      <td>73.684211</td>\n",
       "      <td>57.244737</td>\n",
       "      <td>49.213733</td>\n",
       "      <td>73.306744</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.86</td>\n",
       "      <td>13.05</td>\n",
       "      <td>12.77</td>\n",
       "      <td>12.99</td>\n",
       "      <td>12.89</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.7758</td>\n",
       "      <td>818455.83</td>\n",
       "      <td>1058524.019</td>\n",
       "      <td>89.655172</td>\n",
       "      <td>68.048215</td>\n",
       "      <td>55.491894</td>\n",
       "      <td>93.160859</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.70</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.45</td>\n",
       "      <td>12.99</td>\n",
       "      <td>0.46</td>\n",
       "      <td>3.5412</td>\n",
       "      <td>2122448.34</td>\n",
       "      <td>2861879.086</td>\n",
       "      <td>79.674797</td>\n",
       "      <td>71.923742</td>\n",
       "      <td>60.969177</td>\n",
       "      <td>93.832874</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.37</td>\n",
       "      <td>13.42</td>\n",
       "      <td>13.16</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.45</td>\n",
       "      <td>-0.22</td>\n",
       "      <td>-1.6357</td>\n",
       "      <td>1032802.74</td>\n",
       "      <td>1368222.854</td>\n",
       "      <td>61.788618</td>\n",
       "      <td>68.545368</td>\n",
       "      <td>63.494574</td>\n",
       "      <td>78.646956</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.31</td>\n",
       "      <td>13.11</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.23</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>646989.63</td>\n",
       "      <td>855052.110</td>\n",
       "      <td>61.788618</td>\n",
       "      <td>66.293118</td>\n",
       "      <td>64.427422</td>\n",
       "      <td>70.024510</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.17</td>\n",
       "      <td>13.28</td>\n",
       "      <td>13.11</td>\n",
       "      <td>13.24</td>\n",
       "      <td>13.23</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0756</td>\n",
       "      <td>566001.61</td>\n",
       "      <td>747473.770</td>\n",
       "      <td>60.344828</td>\n",
       "      <td>64.310354</td>\n",
       "      <td>64.388399</td>\n",
       "      <td>64.154265</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-27</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.64</td>\n",
       "      <td>13.25</td>\n",
       "      <td>13.50</td>\n",
       "      <td>13.24</td>\n",
       "      <td>0.26</td>\n",
       "      <td>1.9637</td>\n",
       "      <td>936829.90</td>\n",
       "      <td>1263809.737</td>\n",
       "      <td>82.758621</td>\n",
       "      <td>70.459776</td>\n",
       "      <td>66.412192</td>\n",
       "      <td>78.554946</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.56</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.50</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.1481</td>\n",
       "      <td>771564.17</td>\n",
       "      <td>1038718.080</td>\n",
       "      <td>84.482759</td>\n",
       "      <td>75.134104</td>\n",
       "      <td>69.319496</td>\n",
       "      <td>86.763320</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.48</td>\n",
       "      <td>14.10</td>\n",
       "      <td>13.45</td>\n",
       "      <td>14.02</td>\n",
       "      <td>13.52</td>\n",
       "      <td>0.50</td>\n",
       "      <td>3.6982</td>\n",
       "      <td>1108722.39</td>\n",
       "      <td>1541638.203</td>\n",
       "      <td>94.482759</td>\n",
       "      <td>81.583655</td>\n",
       "      <td>73.407549</td>\n",
       "      <td>97.935868</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-30</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>14.02</td>\n",
       "      <td>14.32</td>\n",
       "      <td>13.88</td>\n",
       "      <td>13.93</td>\n",
       "      <td>14.02</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.6419</td>\n",
       "      <td>819540.43</td>\n",
       "      <td>1155968.238</td>\n",
       "      <td>74.838710</td>\n",
       "      <td>79.335340</td>\n",
       "      <td>75.383479</td>\n",
       "      <td>87.239062</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-06</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.89</td>\n",
       "      <td>13.61</td>\n",
       "      <td>13.77</td>\n",
       "      <td>13.93</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.1486</td>\n",
       "      <td>1008998.02</td>\n",
       "      <td>1382727.481</td>\n",
       "      <td>54.545455</td>\n",
       "      <td>71.072045</td>\n",
       "      <td>73.946335</td>\n",
       "      <td>65.323466</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.60</td>\n",
       "      <td>13.69</td>\n",
       "      <td>13.77</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.5810</td>\n",
       "      <td>662749.23</td>\n",
       "      <td>904349.531</td>\n",
       "      <td>47.933884</td>\n",
       "      <td>63.359325</td>\n",
       "      <td>70.417331</td>\n",
       "      <td>49.243312</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>14.02</td>\n",
       "      <td>13.68</td>\n",
       "      <td>13.95</td>\n",
       "      <td>13.69</td>\n",
       "      <td>0.26</td>\n",
       "      <td>1.8992</td>\n",
       "      <td>934781.70</td>\n",
       "      <td>1297924.588</td>\n",
       "      <td>69.421488</td>\n",
       "      <td>65.380046</td>\n",
       "      <td>68.738236</td>\n",
       "      <td>58.663665</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.92</td>\n",
       "      <td>14.13</td>\n",
       "      <td>13.90</td>\n",
       "      <td>14.00</td>\n",
       "      <td>13.95</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.3584</td>\n",
       "      <td>612862.29</td>\n",
       "      <td>859156.594</td>\n",
       "      <td>73.553719</td>\n",
       "      <td>68.104603</td>\n",
       "      <td>68.527025</td>\n",
       "      <td>67.259760</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-12</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.95</td>\n",
       "      <td>14.05</td>\n",
       "      <td>13.72</td>\n",
       "      <td>13.79</td>\n",
       "      <td>14.00</td>\n",
       "      <td>-0.21</td>\n",
       "      <td>-1.5000</td>\n",
       "      <td>558511.14</td>\n",
       "      <td>772109.502</td>\n",
       "      <td>50.467290</td>\n",
       "      <td>62.225499</td>\n",
       "      <td>66.426516</td>\n",
       "      <td>53.823464</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.75</td>\n",
       "      <td>13.78</td>\n",
       "      <td>13.53</td>\n",
       "      <td>13.63</td>\n",
       "      <td>13.79</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.1603</td>\n",
       "      <td>640358.79</td>\n",
       "      <td>871062.043</td>\n",
       "      <td>34.285714</td>\n",
       "      <td>52.912237</td>\n",
       "      <td>61.921757</td>\n",
       "      <td>34.893199</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.55</td>\n",
       "      <td>13.59</td>\n",
       "      <td>13.22</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.63</td>\n",
       "      <td>-0.33</td>\n",
       "      <td>-2.4211</td>\n",
       "      <td>944672.09</td>\n",
       "      <td>1259440.848</td>\n",
       "      <td>7.272727</td>\n",
       "      <td>37.699067</td>\n",
       "      <td>53.847527</td>\n",
       "      <td>5.402148</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.39</td>\n",
       "      <td>13.43</td>\n",
       "      <td>13.14</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.30</td>\n",
       "      <td>-0.07</td>\n",
       "      <td>-0.5263</td>\n",
       "      <td>756794.47</td>\n",
       "      <td>1004313.267</td>\n",
       "      <td>7.627119</td>\n",
       "      <td>27.675084</td>\n",
       "      <td>45.123379</td>\n",
       "      <td>-7.221506</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.34</td>\n",
       "      <td>13.12</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.23</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2268</td>\n",
       "      <td>637208.57</td>\n",
       "      <td>843479.669</td>\n",
       "      <td>7.920792</td>\n",
       "      <td>21.090320</td>\n",
       "      <td>37.112360</td>\n",
       "      <td>-10.953759</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.41</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.20</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.2121</td>\n",
       "      <td>600368.64</td>\n",
       "      <td>801755.671</td>\n",
       "      <td>23.762376</td>\n",
       "      <td>21.981006</td>\n",
       "      <td>32.068575</td>\n",
       "      <td>1.805867</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.38</td>\n",
       "      <td>13.62</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.51</td>\n",
       "      <td>13.36</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.1228</td>\n",
       "      <td>690851.07</td>\n",
       "      <td>929928.885</td>\n",
       "      <td>38.613861</td>\n",
       "      <td>27.525291</td>\n",
       "      <td>30.554147</td>\n",
       "      <td>21.467579</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.57</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.40</td>\n",
       "      <td>13.51</td>\n",
       "      <td>-0.11</td>\n",
       "      <td>-0.8142</td>\n",
       "      <td>552312.00</td>\n",
       "      <td>742797.057</td>\n",
       "      <td>27.722772</td>\n",
       "      <td>27.591118</td>\n",
       "      <td>29.566471</td>\n",
       "      <td>23.640413</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.40</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.5821</td>\n",
       "      <td>856237.33</td>\n",
       "      <td>1119433.491</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>18.394079</td>\n",
       "      <td>25.842340</td>\n",
       "      <td>3.497556</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>328 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2019-01-14  000001.SZ  10.22  10.25  10.07  10.11      10.20   -0.09  -0.8824   \n",
       "2019-01-15  000001.SZ  10.11  10.28  10.09  10.24      10.11    0.13   1.2859   \n",
       "2019-01-16  000001.SZ  10.24  10.50  10.23  10.48      10.24    0.24   2.3438   \n",
       "2019-01-17  000001.SZ  10.54  10.57  10.17  10.25      10.48   -0.23  -2.1947   \n",
       "2019-01-18  000001.SZ  10.34  10.49  10.28  10.43      10.25    0.18   1.7561   \n",
       "2019-01-21  000001.SZ  10.34  10.47  10.32  10.34      10.43   -0.09  -0.8629   \n",
       "2019-01-22  000001.SZ  10.34  10.44  10.26  10.28      10.34   -0.06  -0.5803   \n",
       "2019-01-23  000001.SZ  10.29  10.47  10.29  10.35      10.28    0.07   0.6809   \n",
       "2019-01-24  000001.SZ  10.40  10.55  10.37  10.52      10.35    0.17   1.6425   \n",
       "2019-01-25  000001.SZ  10.56  11.04  10.55  11.00      10.52    0.48   4.5627   \n",
       "2019-01-28  000001.SZ  11.04  11.14  10.88  10.94      11.00   -0.06  -0.5455   \n",
       "2019-01-29  000001.SZ  10.96  11.07  10.77  11.00      10.94    0.06   0.5484   \n",
       "2019-01-30  000001.SZ  10.95  11.18  10.86  10.95      11.00   -0.05  -0.4545   \n",
       "2019-01-31  000001.SZ  10.98  11.20  10.94  11.10      10.95    0.15   1.3699   \n",
       "2019-02-01  000001.SZ  11.20  11.25  10.96  11.20      11.10    0.10   0.9009   \n",
       "2019-02-11  000001.SZ  11.08  11.21  10.97  11.21      11.20    0.01   0.0893   \n",
       "2019-02-12  000001.SZ  11.20  11.31  11.03  11.19      11.21   -0.02  -0.1784   \n",
       "2019-02-13  000001.SZ  11.19  11.41  11.12  11.38      11.19    0.19   1.6979   \n",
       "2019-02-14  000001.SZ  11.30  11.33  11.19  11.25      11.38   -0.13  -1.1424   \n",
       "2019-02-15  000001.SZ  11.23  11.23  10.90  10.95      11.25   -0.30  -2.6667   \n",
       "2019-02-18  000001.SZ  11.05  11.36  11.04  11.36      10.95    0.41   3.7443   \n",
       "2019-02-19  000001.SZ  11.36  11.62  11.24  11.27      11.36   -0.09  -0.7923   \n",
       "2019-02-20  000001.SZ  11.33  11.53  11.25  11.41      11.27    0.14   1.2422   \n",
       "2019-02-21  000001.SZ  11.38  11.55  11.28  11.36      11.41   -0.05  -0.4382   \n",
       "2019-02-22  000001.SZ  11.35  11.57  11.15  11.54      11.36    0.18   1.5845   \n",
       "2019-02-25  000001.SZ  11.70  12.64  11.57  12.55      11.54    1.01   8.7522   \n",
       "2019-02-26  000001.SZ  12.55  12.57  12.15  12.20      12.55   -0.35  -2.7888   \n",
       "2019-02-27  000001.SZ  12.24  12.66  12.15  12.40      12.20    0.20   1.6393   \n",
       "2019-02-28  000001.SZ  12.44  12.61  12.27  12.36      12.40   -0.04  -0.3226   \n",
       "2019-03-01  000001.SZ  12.48  12.78  12.20  12.76      12.36    0.40   3.2362   \n",
       "...               ...    ...    ...    ...    ...        ...     ...      ...   \n",
       "2020-04-08  000001.SZ  12.88  12.92  12.72  12.78      12.88   -0.10  -0.7764   \n",
       "2020-04-09  000001.SZ  12.88  12.89  12.72  12.74      12.78   -0.04  -0.3130   \n",
       "2020-04-10  000001.SZ  12.76  12.98  12.65  12.79      12.74    0.05   0.3925   \n",
       "2020-04-13  000001.SZ  12.67  12.71  12.47  12.59      12.79   -0.20  -1.5637   \n",
       "2020-04-14  000001.SZ  12.65  12.86  12.57  12.86      12.59    0.27   2.1446   \n",
       "2020-04-15  000001.SZ  12.86  12.93  12.78  12.87      12.86    0.01   0.0778   \n",
       "2020-04-16  000001.SZ  12.79  12.79  12.54  12.68      12.87   -0.19  -1.4763   \n",
       "2020-04-17  000001.SZ  12.77  13.04  12.65  12.89      12.68    0.21   1.6562   \n",
       "2020-04-20  000001.SZ  12.86  13.05  12.77  12.99      12.89    0.10   0.7758   \n",
       "2020-04-21  000001.SZ  13.30  13.70  13.30  13.45      12.99    0.46   3.5412   \n",
       "2020-04-22  000001.SZ  13.37  13.42  13.16  13.23      13.45   -0.22  -1.6357   \n",
       "2020-04-23  000001.SZ  13.23  13.31  13.11  13.23      13.23    0.00   0.0000   \n",
       "2020-04-24  000001.SZ  13.17  13.28  13.11  13.24      13.23    0.01   0.0756   \n",
       "2020-04-27  000001.SZ  13.30  13.64  13.25  13.50      13.24    0.26   1.9637   \n",
       "2020-04-28  000001.SZ  13.45  13.56  13.27  13.52      13.50    0.02   0.1481   \n",
       "2020-04-29  000001.SZ  13.48  14.10  13.45  14.02      13.52    0.50   3.6982   \n",
       "2020-04-30  000001.SZ  14.02  14.32  13.88  13.93      14.02   -0.09  -0.6419   \n",
       "2020-05-06  000001.SZ  13.76  13.89  13.61  13.77      13.93   -0.16  -1.1486   \n",
       "2020-05-07  000001.SZ  13.76  13.76  13.60  13.69      13.77   -0.08  -0.5810   \n",
       "2020-05-08  000001.SZ  13.76  14.02  13.68  13.95      13.69    0.26   1.8992   \n",
       "2020-05-11  000001.SZ  13.92  14.13  13.90  14.00      13.95    0.05   0.3584   \n",
       "2020-05-12  000001.SZ  13.95  14.05  13.72  13.79      14.00   -0.21  -1.5000   \n",
       "2020-05-13  000001.SZ  13.75  13.78  13.53  13.63      13.79   -0.16  -1.1603   \n",
       "2020-05-14  000001.SZ  13.55  13.59  13.22  13.30      13.63   -0.33  -2.4211   \n",
       "2020-05-15  000001.SZ  13.39  13.43  13.14  13.23      13.30   -0.07  -0.5263   \n",
       "2020-05-18  000001.SZ  13.20  13.34  13.12  13.20      13.23   -0.03  -0.2268   \n",
       "2020-05-19  000001.SZ  13.41  13.45  13.27  13.36      13.20    0.16   1.2121   \n",
       "2020-05-20  000001.SZ  13.38  13.62  13.27  13.51      13.36    0.15   1.1228   \n",
       "2020-05-21  000001.SZ  13.52  13.57  13.36  13.40      13.51   -0.11  -0.8142   \n",
       "2020-05-22  000001.SZ  13.33  13.34  12.92  12.92      13.40   -0.48  -3.5821   \n",
       "\n",
       "                   vol       amount        RSV          K          D  \\\n",
       "trade_date                                                             \n",
       "2019-01-14   500443.59   507862.882  87.272727  87.272727  87.272727   \n",
       "2019-01-15   542160.55   553027.309  96.460177  92.785197  90.580209   \n",
       "2019-01-16   977699.37  1017495.116  98.437500  95.462604  92.892922   \n",
       "2019-01-17   882811.92   910212.066  66.315789  83.355466  88.931210   \n",
       "2019-01-18   738793.26   769973.637  85.263158  84.087802  87.071892   \n",
       "2019-01-21   659355.76   684465.646  73.563218  80.241977  84.576149   \n",
       "2019-01-22   424413.57   438991.450  59.154930  72.775995  80.398241   \n",
       "2019-01-23   537876.63   559384.396  57.692308  67.543953  75.939505   \n",
       "2019-01-24   679240.88   711495.718  90.000000  75.229213  75.696418   \n",
       "2019-01-25  2108361.85  2299718.224  95.789474  82.203580  77.903750   \n",
       "2019-01-28  1035909.80  1141853.833  79.381443  81.251865  79.032842   \n",
       "2019-01-29   826631.10   904847.854  85.567010  82.701419  80.265199   \n",
       "2019-01-30   712001.01   785204.571  75.000000  80.121020  80.216891   \n",
       "2019-01-31   831622.75   922602.874  89.361702  83.211835  81.218637   \n",
       "2019-02-01  1014270.07  1127216.186  94.949495  87.133344  83.194719   \n",
       "2019-02-11   801936.63   889951.528  95.833333  90.037762  85.479211   \n",
       "2019-02-12   959936.90  1071873.084  87.234043  89.102239  86.688114   \n",
       "2019-02-13  1137365.74  1280182.096  96.511628  91.573708  88.317748   \n",
       "2019-02-14   869185.19   977818.097  75.000000  86.046645  87.560372   \n",
       "2019-02-15  1100127.46  1213914.428  28.125000  66.733622  80.616034   \n",
       "2019-02-18  1255522.21  1408279.680  90.909091  74.793728  78.674876   \n",
       "2019-02-19  1270882.04  1445281.382  51.388889  66.991072  74.779754   \n",
       "2019-02-20   832629.87   949430.819  70.833333  68.271940  72.610289   \n",
       "2019-02-21   754246.48   860591.070  63.888889  66.810836  70.677023   \n",
       "2019-02-22  1184047.79  1343020.336  88.888889  74.170478  71.841555   \n",
       "2019-02-25  2824935.02  3415946.860  94.827586  81.056363  74.913238   \n",
       "2019-02-26  2017544.93  2485673.356  74.712644  78.941753  76.256100   \n",
       "2019-02-27  1979013.88  2454404.411  85.227273  81.036951  77.849736   \n",
       "2019-02-28  1113099.80  1383110.810  81.481481  81.185129  78.961542   \n",
       "2019-03-01  1712679.16  2137669.556  98.773006  87.047785  81.656970   \n",
       "...                ...          ...        ...        ...        ...   \n",
       "2020-04-08   528716.14   676604.872  27.710843  40.903345  46.958157   \n",
       "2020-04-09   408553.77   522027.888  22.891566  34.899419  42.938578   \n",
       "2020-04-10   666674.95   853689.950  41.379310  37.059383  40.978846   \n",
       "2020-04-13   446214.40   562008.050  18.181818  30.766861  37.574851   \n",
       "2020-04-14   686086.87   874856.562  59.090909  40.208211  38.452638   \n",
       "2020-04-15   656396.40   843649.273  78.431373  52.949265  43.284847   \n",
       "2020-04-16   789154.98   997623.816  41.176471  49.025000  45.198231   \n",
       "2020-04-17  1331164.77  1713215.766  73.684211  57.244737  49.213733   \n",
       "2020-04-20   818455.83  1058524.019  89.655172  68.048215  55.491894   \n",
       "2020-04-21  2122448.34  2861879.086  79.674797  71.923742  60.969177   \n",
       "2020-04-22  1032802.74  1368222.854  61.788618  68.545368  63.494574   \n",
       "2020-04-23   646989.63   855052.110  61.788618  66.293118  64.427422   \n",
       "2020-04-24   566001.61   747473.770  60.344828  64.310354  64.388399   \n",
       "2020-04-27   936829.90  1263809.737  82.758621  70.459776  66.412192   \n",
       "2020-04-28   771564.17  1038718.080  84.482759  75.134104  69.319496   \n",
       "2020-04-29  1108722.39  1541638.203  94.482759  81.583655  73.407549   \n",
       "2020-04-30   819540.43  1155968.238  74.838710  79.335340  75.383479   \n",
       "2020-05-06  1008998.02  1382727.481  54.545455  71.072045  73.946335   \n",
       "2020-05-07   662749.23   904349.531  47.933884  63.359325  70.417331   \n",
       "2020-05-08   934781.70  1297924.588  69.421488  65.380046  68.738236   \n",
       "2020-05-11   612862.29   859156.594  73.553719  68.104603  68.527025   \n",
       "2020-05-12   558511.14   772109.502  50.467290  62.225499  66.426516   \n",
       "2020-05-13   640358.79   871062.043  34.285714  52.912237  61.921757   \n",
       "2020-05-14   944672.09  1259440.848   7.272727  37.699067  53.847527   \n",
       "2020-05-15   756794.47  1004313.267   7.627119  27.675084  45.123379   \n",
       "2020-05-18   637208.57   843479.669   7.920792  21.090320  37.112360   \n",
       "2020-05-19   600368.64   801755.671  23.762376  21.981006  32.068575   \n",
       "2020-05-20   690851.07   929928.885  38.613861  27.525291  30.554147   \n",
       "2020-05-21   552312.00   742797.057  27.722772  27.591118  29.566471   \n",
       "2020-05-22   856237.33  1119433.491   0.000000  18.394079  25.842340   \n",
       "\n",
       "                     J KDJ金叉死叉  \n",
       "trade_date                      \n",
       "2019-01-14   87.272727          \n",
       "2019-01-15   97.195173      金叉  \n",
       "2019-01-16  100.601966          \n",
       "2019-01-17   72.203977          \n",
       "2019-01-18   78.119623          \n",
       "2019-01-21   71.573634          \n",
       "2019-01-22   57.531502          \n",
       "2019-01-23   50.752848          \n",
       "2019-01-24   74.294804          \n",
       "2019-01-25   90.803238      金叉  \n",
       "2019-01-28   85.689910          \n",
       "2019-01-29   87.573858          \n",
       "2019-01-30   79.929279          \n",
       "2019-01-31   87.198231      金叉  \n",
       "2019-02-01   95.010594          \n",
       "2019-02-11   99.154864          \n",
       "2019-02-12   93.930490          \n",
       "2019-02-13   98.085627          \n",
       "2019-02-14   83.019192          \n",
       "2019-02-15   38.968799          \n",
       "2019-02-18   67.031431          \n",
       "2019-02-19   51.413708          \n",
       "2019-02-20   59.595241          \n",
       "2019-02-21   59.078461          \n",
       "2019-02-22   78.828326      金叉  \n",
       "2019-02-25   93.342612          \n",
       "2019-02-26   84.313058          \n",
       "2019-02-27   87.411380          \n",
       "2019-02-28   85.632302          \n",
       "2019-03-01   97.829414          \n",
       "...                ...     ...  \n",
       "2020-04-08   28.793722          \n",
       "2020-04-09   18.821102          \n",
       "2020-04-10   29.220456          \n",
       "2020-04-13   17.150882          \n",
       "2020-04-14   43.719356      金叉  \n",
       "2020-04-15   72.278100          \n",
       "2020-04-16   56.678538          \n",
       "2020-04-17   73.306744          \n",
       "2020-04-20   93.160859          \n",
       "2020-04-21   93.832874          \n",
       "2020-04-22   78.646956          \n",
       "2020-04-23   70.024510          \n",
       "2020-04-24   64.154265          \n",
       "2020-04-27   78.554946      金叉  \n",
       "2020-04-28   86.763320          \n",
       "2020-04-29   97.935868          \n",
       "2020-04-30   87.239062          \n",
       "2020-05-06   65.323466          \n",
       "2020-05-07   49.243312          \n",
       "2020-05-08   58.663665          \n",
       "2020-05-11   67.259760          \n",
       "2020-05-12   53.823464          \n",
       "2020-05-13   34.893199          \n",
       "2020-05-14    5.402148          \n",
       "2020-05-15   -7.221506          \n",
       "2020-05-18  -10.953759          \n",
       "2020-05-19    1.805867          \n",
       "2020-05-20   21.467579          \n",
       "2020-05-21   23.640413          \n",
       "2020-05-22    3.497556          \n",
       "\n",
       "[328 rows x 15 columns]"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole.loc[KDJ_Cross_Bool[(KDJ_Cross_Bool ==False)&(KDJ_Cross_Bool_Tomorrow ==True)].index,'KDJ金叉死叉'] = '死叉' "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>RSV</th>\n",
       "      <th>K</th>\n",
       "      <th>D</th>\n",
       "      <th>J</th>\n",
       "      <th>KDJ金叉死叉</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>trade_date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.22</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.07</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.20</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8824</td>\n",
       "      <td>500443.59</td>\n",
       "      <td>507862.882</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td>87.272727</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.11</td>\n",
       "      <td>0.13</td>\n",
       "      <td>1.2859</td>\n",
       "      <td>542160.55</td>\n",
       "      <td>553027.309</td>\n",
       "      <td>96.460177</td>\n",
       "      <td>92.785197</td>\n",
       "      <td>90.580209</td>\n",
       "      <td>97.195173</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.23</td>\n",
       "      <td>10.48</td>\n",
       "      <td>10.24</td>\n",
       "      <td>0.24</td>\n",
       "      <td>2.3438</td>\n",
       "      <td>977699.37</td>\n",
       "      <td>1017495.116</td>\n",
       "      <td>98.437500</td>\n",
       "      <td>95.462604</td>\n",
       "      <td>92.892922</td>\n",
       "      <td>100.601966</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.57</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.48</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.1947</td>\n",
       "      <td>882811.92</td>\n",
       "      <td>910212.066</td>\n",
       "      <td>66.315789</td>\n",
       "      <td>83.355466</td>\n",
       "      <td>88.931210</td>\n",
       "      <td>72.203977</td>\n",
       "      <td>死叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.49</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.43</td>\n",
       "      <td>10.25</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.7561</td>\n",
       "      <td>738793.26</td>\n",
       "      <td>769973.637</td>\n",
       "      <td>85.263158</td>\n",
       "      <td>84.087802</td>\n",
       "      <td>87.071892</td>\n",
       "      <td>78.119623</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.32</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.43</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.8629</td>\n",
       "      <td>659355.76</td>\n",
       "      <td>684465.646</td>\n",
       "      <td>73.563218</td>\n",
       "      <td>80.241977</td>\n",
       "      <td>84.576149</td>\n",
       "      <td>71.573634</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.44</td>\n",
       "      <td>10.26</td>\n",
       "      <td>10.28</td>\n",
       "      <td>10.34</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5803</td>\n",
       "      <td>424413.57</td>\n",
       "      <td>438991.450</td>\n",
       "      <td>59.154930</td>\n",
       "      <td>72.775995</td>\n",
       "      <td>80.398241</td>\n",
       "      <td>57.531502</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.47</td>\n",
       "      <td>10.29</td>\n",
       "      <td>10.35</td>\n",
       "      <td>10.28</td>\n",
       "      <td>0.07</td>\n",
       "      <td>0.6809</td>\n",
       "      <td>537876.63</td>\n",
       "      <td>559384.396</td>\n",
       "      <td>57.692308</td>\n",
       "      <td>67.543953</td>\n",
       "      <td>75.939505</td>\n",
       "      <td>50.752848</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.40</td>\n",
       "      <td>10.55</td>\n",
       "      <td>10.37</td>\n",
       "      <td>10.52</td>\n",
       "      <td>10.35</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.6425</td>\n",
       "      <td>679240.88</td>\n",
       "      <td>711495.718</td>\n",
       "      <td>90.000000</td>\n",
       "      <td>75.229213</td>\n",
       "      <td>75.696418</td>\n",
       "      <td>74.294804</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.56</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.55</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.52</td>\n",
       "      <td>0.48</td>\n",
       "      <td>4.5627</td>\n",
       "      <td>2108361.85</td>\n",
       "      <td>2299718.224</td>\n",
       "      <td>95.789474</td>\n",
       "      <td>82.203580</td>\n",
       "      <td>77.903750</td>\n",
       "      <td>90.803238</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5455</td>\n",
       "      <td>1035909.80</td>\n",
       "      <td>1141853.833</td>\n",
       "      <td>79.381443</td>\n",
       "      <td>81.251865</td>\n",
       "      <td>79.032842</td>\n",
       "      <td>85.689910</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.07</td>\n",
       "      <td>10.77</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.94</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5484</td>\n",
       "      <td>826631.10</td>\n",
       "      <td>904847.854</td>\n",
       "      <td>85.567010</td>\n",
       "      <td>82.701419</td>\n",
       "      <td>80.265199</td>\n",
       "      <td>87.573858</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-30</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.18</td>\n",
       "      <td>10.86</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.00</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4545</td>\n",
       "      <td>712001.01</td>\n",
       "      <td>785204.571</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>80.121020</td>\n",
       "      <td>80.216891</td>\n",
       "      <td>79.929279</td>\n",
       "      <td>死叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>10.98</td>\n",
       "      <td>11.20</td>\n",
       "      <td>10.94</td>\n",
       "      <td>11.10</td>\n",
       "      <td>10.95</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.3699</td>\n",
       "      <td>831622.75</td>\n",
       "      <td>922602.874</td>\n",
       "      <td>89.361702</td>\n",
       "      <td>83.211835</td>\n",
       "      <td>81.218637</td>\n",
       "      <td>87.198231</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-01</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.25</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.10</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.9009</td>\n",
       "      <td>1014270.07</td>\n",
       "      <td>1127216.186</td>\n",
       "      <td>94.949495</td>\n",
       "      <td>87.133344</td>\n",
       "      <td>83.194719</td>\n",
       "      <td>95.010594</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.21</td>\n",
       "      <td>10.97</td>\n",
       "      <td>11.21</td>\n",
       "      <td>11.20</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0893</td>\n",
       "      <td>801936.63</td>\n",
       "      <td>889951.528</td>\n",
       "      <td>95.833333</td>\n",
       "      <td>90.037762</td>\n",
       "      <td>85.479211</td>\n",
       "      <td>99.154864</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-12</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.20</td>\n",
       "      <td>11.31</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.21</td>\n",
       "      <td>-0.02</td>\n",
       "      <td>-0.1784</td>\n",
       "      <td>959936.90</td>\n",
       "      <td>1071873.084</td>\n",
       "      <td>87.234043</td>\n",
       "      <td>89.102239</td>\n",
       "      <td>86.688114</td>\n",
       "      <td>93.930490</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.12</td>\n",
       "      <td>11.38</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.19</td>\n",
       "      <td>1.6979</td>\n",
       "      <td>1137365.74</td>\n",
       "      <td>1280182.096</td>\n",
       "      <td>96.511628</td>\n",
       "      <td>91.573708</td>\n",
       "      <td>88.317748</td>\n",
       "      <td>98.085627</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.30</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.25</td>\n",
       "      <td>11.38</td>\n",
       "      <td>-0.13</td>\n",
       "      <td>-1.1424</td>\n",
       "      <td>869185.19</td>\n",
       "      <td>977818.097</td>\n",
       "      <td>75.000000</td>\n",
       "      <td>86.046645</td>\n",
       "      <td>87.560372</td>\n",
       "      <td>83.019192</td>\n",
       "      <td>死叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.23</td>\n",
       "      <td>11.23</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.25</td>\n",
       "      <td>-0.30</td>\n",
       "      <td>-2.6667</td>\n",
       "      <td>1100127.46</td>\n",
       "      <td>1213914.428</td>\n",
       "      <td>28.125000</td>\n",
       "      <td>66.733622</td>\n",
       "      <td>80.616034</td>\n",
       "      <td>38.968799</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.36</td>\n",
       "      <td>10.95</td>\n",
       "      <td>0.41</td>\n",
       "      <td>3.7443</td>\n",
       "      <td>1255522.21</td>\n",
       "      <td>1408279.680</td>\n",
       "      <td>90.909091</td>\n",
       "      <td>74.793728</td>\n",
       "      <td>78.674876</td>\n",
       "      <td>67.031431</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.62</td>\n",
       "      <td>11.24</td>\n",
       "      <td>11.27</td>\n",
       "      <td>11.36</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.7923</td>\n",
       "      <td>1270882.04</td>\n",
       "      <td>1445281.382</td>\n",
       "      <td>51.388889</td>\n",
       "      <td>66.991072</td>\n",
       "      <td>74.779754</td>\n",
       "      <td>51.413708</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.33</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.25</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.27</td>\n",
       "      <td>0.14</td>\n",
       "      <td>1.2422</td>\n",
       "      <td>832629.87</td>\n",
       "      <td>949430.819</td>\n",
       "      <td>70.833333</td>\n",
       "      <td>68.271940</td>\n",
       "      <td>72.610289</td>\n",
       "      <td>59.595241</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.38</td>\n",
       "      <td>11.55</td>\n",
       "      <td>11.28</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.41</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4382</td>\n",
       "      <td>754246.48</td>\n",
       "      <td>860591.070</td>\n",
       "      <td>63.888889</td>\n",
       "      <td>66.810836</td>\n",
       "      <td>70.677023</td>\n",
       "      <td>59.078461</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.35</td>\n",
       "      <td>11.57</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.54</td>\n",
       "      <td>11.36</td>\n",
       "      <td>0.18</td>\n",
       "      <td>1.5845</td>\n",
       "      <td>1184047.79</td>\n",
       "      <td>1343020.336</td>\n",
       "      <td>88.888889</td>\n",
       "      <td>74.170478</td>\n",
       "      <td>71.841555</td>\n",
       "      <td>78.828326</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-25</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>11.70</td>\n",
       "      <td>12.64</td>\n",
       "      <td>11.57</td>\n",
       "      <td>12.55</td>\n",
       "      <td>11.54</td>\n",
       "      <td>1.01</td>\n",
       "      <td>8.7522</td>\n",
       "      <td>2824935.02</td>\n",
       "      <td>3415946.860</td>\n",
       "      <td>94.827586</td>\n",
       "      <td>81.056363</td>\n",
       "      <td>74.913238</td>\n",
       "      <td>93.342612</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-26</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.55</td>\n",
       "      <td>12.57</td>\n",
       "      <td>12.15</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.55</td>\n",
       "      <td>-0.35</td>\n",
       "      <td>-2.7888</td>\n",
       "      <td>2017544.93</td>\n",
       "      <td>2485673.356</td>\n",
       "      <td>74.712644</td>\n",
       "      <td>78.941753</td>\n",
       "      <td>76.256100</td>\n",
       "      <td>84.313058</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-27</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.24</td>\n",
       "      <td>12.66</td>\n",
       "      <td>12.15</td>\n",
       "      <td>12.40</td>\n",
       "      <td>12.20</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.6393</td>\n",
       "      <td>1979013.88</td>\n",
       "      <td>2454404.411</td>\n",
       "      <td>85.227273</td>\n",
       "      <td>81.036951</td>\n",
       "      <td>77.849736</td>\n",
       "      <td>87.411380</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.44</td>\n",
       "      <td>12.61</td>\n",
       "      <td>12.27</td>\n",
       "      <td>12.36</td>\n",
       "      <td>12.40</td>\n",
       "      <td>-0.04</td>\n",
       "      <td>-0.3226</td>\n",
       "      <td>1113099.80</td>\n",
       "      <td>1383110.810</td>\n",
       "      <td>81.481481</td>\n",
       "      <td>81.185129</td>\n",
       "      <td>78.961542</td>\n",
       "      <td>85.632302</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-01</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.36</td>\n",
       "      <td>0.40</td>\n",
       "      <td>3.2362</td>\n",
       "      <td>1712679.16</td>\n",
       "      <td>2137669.556</td>\n",
       "      <td>98.773006</td>\n",
       "      <td>87.047785</td>\n",
       "      <td>81.656970</td>\n",
       "      <td>97.829414</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.88</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.72</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.88</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>-0.7764</td>\n",
       "      <td>528716.14</td>\n",
       "      <td>676604.872</td>\n",
       "      <td>27.710843</td>\n",
       "      <td>40.903345</td>\n",
       "      <td>46.958157</td>\n",
       "      <td>28.793722</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-09</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.88</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.72</td>\n",
       "      <td>12.74</td>\n",
       "      <td>12.78</td>\n",
       "      <td>-0.04</td>\n",
       "      <td>-0.3130</td>\n",
       "      <td>408553.77</td>\n",
       "      <td>522027.888</td>\n",
       "      <td>22.891566</td>\n",
       "      <td>34.899419</td>\n",
       "      <td>42.938578</td>\n",
       "      <td>18.821102</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-10</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.98</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.74</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.3925</td>\n",
       "      <td>666674.95</td>\n",
       "      <td>853689.950</td>\n",
       "      <td>41.379310</td>\n",
       "      <td>37.059383</td>\n",
       "      <td>40.978846</td>\n",
       "      <td>29.220456</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.67</td>\n",
       "      <td>12.71</td>\n",
       "      <td>12.47</td>\n",
       "      <td>12.59</td>\n",
       "      <td>12.79</td>\n",
       "      <td>-0.20</td>\n",
       "      <td>-1.5637</td>\n",
       "      <td>446214.40</td>\n",
       "      <td>562008.050</td>\n",
       "      <td>18.181818</td>\n",
       "      <td>30.766861</td>\n",
       "      <td>37.574851</td>\n",
       "      <td>17.150882</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.57</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.59</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2.1446</td>\n",
       "      <td>686086.87</td>\n",
       "      <td>874856.562</td>\n",
       "      <td>59.090909</td>\n",
       "      <td>40.208211</td>\n",
       "      <td>38.452638</td>\n",
       "      <td>43.719356</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.93</td>\n",
       "      <td>12.78</td>\n",
       "      <td>12.87</td>\n",
       "      <td>12.86</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0778</td>\n",
       "      <td>656396.40</td>\n",
       "      <td>843649.273</td>\n",
       "      <td>78.431373</td>\n",
       "      <td>52.949265</td>\n",
       "      <td>43.284847</td>\n",
       "      <td>72.278100</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-16</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.79</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.68</td>\n",
       "      <td>12.87</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-1.4763</td>\n",
       "      <td>789154.98</td>\n",
       "      <td>997623.816</td>\n",
       "      <td>41.176471</td>\n",
       "      <td>49.025000</td>\n",
       "      <td>45.198231</td>\n",
       "      <td>56.678538</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-17</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.77</td>\n",
       "      <td>13.04</td>\n",
       "      <td>12.65</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.68</td>\n",
       "      <td>0.21</td>\n",
       "      <td>1.6562</td>\n",
       "      <td>1331164.77</td>\n",
       "      <td>1713215.766</td>\n",
       "      <td>73.684211</td>\n",
       "      <td>57.244737</td>\n",
       "      <td>49.213733</td>\n",
       "      <td>73.306744</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>12.86</td>\n",
       "      <td>13.05</td>\n",
       "      <td>12.77</td>\n",
       "      <td>12.99</td>\n",
       "      <td>12.89</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.7758</td>\n",
       "      <td>818455.83</td>\n",
       "      <td>1058524.019</td>\n",
       "      <td>89.655172</td>\n",
       "      <td>68.048215</td>\n",
       "      <td>55.491894</td>\n",
       "      <td>93.160859</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.70</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.45</td>\n",
       "      <td>12.99</td>\n",
       "      <td>0.46</td>\n",
       "      <td>3.5412</td>\n",
       "      <td>2122448.34</td>\n",
       "      <td>2861879.086</td>\n",
       "      <td>79.674797</td>\n",
       "      <td>71.923742</td>\n",
       "      <td>60.969177</td>\n",
       "      <td>93.832874</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.37</td>\n",
       "      <td>13.42</td>\n",
       "      <td>13.16</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.45</td>\n",
       "      <td>-0.22</td>\n",
       "      <td>-1.6357</td>\n",
       "      <td>1032802.74</td>\n",
       "      <td>1368222.854</td>\n",
       "      <td>61.788618</td>\n",
       "      <td>68.545368</td>\n",
       "      <td>63.494574</td>\n",
       "      <td>78.646956</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-23</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.31</td>\n",
       "      <td>13.11</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.23</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>646989.63</td>\n",
       "      <td>855052.110</td>\n",
       "      <td>61.788618</td>\n",
       "      <td>66.293118</td>\n",
       "      <td>64.427422</td>\n",
       "      <td>70.024510</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-24</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.17</td>\n",
       "      <td>13.28</td>\n",
       "      <td>13.11</td>\n",
       "      <td>13.24</td>\n",
       "      <td>13.23</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0756</td>\n",
       "      <td>566001.61</td>\n",
       "      <td>747473.770</td>\n",
       "      <td>60.344828</td>\n",
       "      <td>64.310354</td>\n",
       "      <td>64.388399</td>\n",
       "      <td>64.154265</td>\n",
       "      <td>死叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-27</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.64</td>\n",
       "      <td>13.25</td>\n",
       "      <td>13.50</td>\n",
       "      <td>13.24</td>\n",
       "      <td>0.26</td>\n",
       "      <td>1.9637</td>\n",
       "      <td>936829.90</td>\n",
       "      <td>1263809.737</td>\n",
       "      <td>82.758621</td>\n",
       "      <td>70.459776</td>\n",
       "      <td>66.412192</td>\n",
       "      <td>78.554946</td>\n",
       "      <td>金叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-28</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.56</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.50</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.1481</td>\n",
       "      <td>771564.17</td>\n",
       "      <td>1038718.080</td>\n",
       "      <td>84.482759</td>\n",
       "      <td>75.134104</td>\n",
       "      <td>69.319496</td>\n",
       "      <td>86.763320</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-29</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.48</td>\n",
       "      <td>14.10</td>\n",
       "      <td>13.45</td>\n",
       "      <td>14.02</td>\n",
       "      <td>13.52</td>\n",
       "      <td>0.50</td>\n",
       "      <td>3.6982</td>\n",
       "      <td>1108722.39</td>\n",
       "      <td>1541638.203</td>\n",
       "      <td>94.482759</td>\n",
       "      <td>81.583655</td>\n",
       "      <td>73.407549</td>\n",
       "      <td>97.935868</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-04-30</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>14.02</td>\n",
       "      <td>14.32</td>\n",
       "      <td>13.88</td>\n",
       "      <td>13.93</td>\n",
       "      <td>14.02</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-0.6419</td>\n",
       "      <td>819540.43</td>\n",
       "      <td>1155968.238</td>\n",
       "      <td>74.838710</td>\n",
       "      <td>79.335340</td>\n",
       "      <td>75.383479</td>\n",
       "      <td>87.239062</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-06</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.89</td>\n",
       "      <td>13.61</td>\n",
       "      <td>13.77</td>\n",
       "      <td>13.93</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.1486</td>\n",
       "      <td>1008998.02</td>\n",
       "      <td>1382727.481</td>\n",
       "      <td>54.545455</td>\n",
       "      <td>71.072045</td>\n",
       "      <td>73.946335</td>\n",
       "      <td>65.323466</td>\n",
       "      <td>死叉</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-07</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.76</td>\n",
       "      <td>13.60</td>\n",
       "      <td>13.69</td>\n",
       "      <td>13.77</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.5810</td>\n",
       "      <td>662749.23</td>\n",
       "      <td>904349.531</td>\n",
       "      <td>47.933884</td>\n",
       "      <td>63.359325</td>\n",
       "      <td>70.417331</td>\n",
       "      <td>49.243312</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-08</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.76</td>\n",
       "      <td>14.02</td>\n",
       "      <td>13.68</td>\n",
       "      <td>13.95</td>\n",
       "      <td>13.69</td>\n",
       "      <td>0.26</td>\n",
       "      <td>1.8992</td>\n",
       "      <td>934781.70</td>\n",
       "      <td>1297924.588</td>\n",
       "      <td>69.421488</td>\n",
       "      <td>65.380046</td>\n",
       "      <td>68.738236</td>\n",
       "      <td>58.663665</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-11</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.92</td>\n",
       "      <td>14.13</td>\n",
       "      <td>13.90</td>\n",
       "      <td>14.00</td>\n",
       "      <td>13.95</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.3584</td>\n",
       "      <td>612862.29</td>\n",
       "      <td>859156.594</td>\n",
       "      <td>73.553719</td>\n",
       "      <td>68.104603</td>\n",
       "      <td>68.527025</td>\n",
       "      <td>67.259760</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-12</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.95</td>\n",
       "      <td>14.05</td>\n",
       "      <td>13.72</td>\n",
       "      <td>13.79</td>\n",
       "      <td>14.00</td>\n",
       "      <td>-0.21</td>\n",
       "      <td>-1.5000</td>\n",
       "      <td>558511.14</td>\n",
       "      <td>772109.502</td>\n",
       "      <td>50.467290</td>\n",
       "      <td>62.225499</td>\n",
       "      <td>66.426516</td>\n",
       "      <td>53.823464</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-13</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.75</td>\n",
       "      <td>13.78</td>\n",
       "      <td>13.53</td>\n",
       "      <td>13.63</td>\n",
       "      <td>13.79</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.1603</td>\n",
       "      <td>640358.79</td>\n",
       "      <td>871062.043</td>\n",
       "      <td>34.285714</td>\n",
       "      <td>52.912237</td>\n",
       "      <td>61.921757</td>\n",
       "      <td>34.893199</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-14</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.55</td>\n",
       "      <td>13.59</td>\n",
       "      <td>13.22</td>\n",
       "      <td>13.30</td>\n",
       "      <td>13.63</td>\n",
       "      <td>-0.33</td>\n",
       "      <td>-2.4211</td>\n",
       "      <td>944672.09</td>\n",
       "      <td>1259440.848</td>\n",
       "      <td>7.272727</td>\n",
       "      <td>37.699067</td>\n",
       "      <td>53.847527</td>\n",
       "      <td>5.402148</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-15</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.39</td>\n",
       "      <td>13.43</td>\n",
       "      <td>13.14</td>\n",
       "      <td>13.23</td>\n",
       "      <td>13.30</td>\n",
       "      <td>-0.07</td>\n",
       "      <td>-0.5263</td>\n",
       "      <td>756794.47</td>\n",
       "      <td>1004313.267</td>\n",
       "      <td>7.627119</td>\n",
       "      <td>27.675084</td>\n",
       "      <td>45.123379</td>\n",
       "      <td>-7.221506</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-18</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.34</td>\n",
       "      <td>13.12</td>\n",
       "      <td>13.20</td>\n",
       "      <td>13.23</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2268</td>\n",
       "      <td>637208.57</td>\n",
       "      <td>843479.669</td>\n",
       "      <td>7.920792</td>\n",
       "      <td>21.090320</td>\n",
       "      <td>37.112360</td>\n",
       "      <td>-10.953759</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-19</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.41</td>\n",
       "      <td>13.45</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.20</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.2121</td>\n",
       "      <td>600368.64</td>\n",
       "      <td>801755.671</td>\n",
       "      <td>23.762376</td>\n",
       "      <td>21.981006</td>\n",
       "      <td>32.068575</td>\n",
       "      <td>1.805867</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-20</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.38</td>\n",
       "      <td>13.62</td>\n",
       "      <td>13.27</td>\n",
       "      <td>13.51</td>\n",
       "      <td>13.36</td>\n",
       "      <td>0.15</td>\n",
       "      <td>1.1228</td>\n",
       "      <td>690851.07</td>\n",
       "      <td>929928.885</td>\n",
       "      <td>38.613861</td>\n",
       "      <td>27.525291</td>\n",
       "      <td>30.554147</td>\n",
       "      <td>21.467579</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-21</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.52</td>\n",
       "      <td>13.57</td>\n",
       "      <td>13.36</td>\n",
       "      <td>13.40</td>\n",
       "      <td>13.51</td>\n",
       "      <td>-0.11</td>\n",
       "      <td>-0.8142</td>\n",
       "      <td>552312.00</td>\n",
       "      <td>742797.057</td>\n",
       "      <td>27.722772</td>\n",
       "      <td>27.591118</td>\n",
       "      <td>29.566471</td>\n",
       "      <td>23.640413</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2020-05-22</th>\n",
       "      <td>000001.SZ</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.40</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.5821</td>\n",
       "      <td>856237.33</td>\n",
       "      <td>1119433.491</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>18.394079</td>\n",
       "      <td>25.842340</td>\n",
       "      <td>3.497556</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>328 rows × 15 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              ts_code   open   high    low  close  pre_close  change  pct_chg  \\\n",
       "trade_date                                                                      \n",
       "2019-01-14  000001.SZ  10.22  10.25  10.07  10.11      10.20   -0.09  -0.8824   \n",
       "2019-01-15  000001.SZ  10.11  10.28  10.09  10.24      10.11    0.13   1.2859   \n",
       "2019-01-16  000001.SZ  10.24  10.50  10.23  10.48      10.24    0.24   2.3438   \n",
       "2019-01-17  000001.SZ  10.54  10.57  10.17  10.25      10.48   -0.23  -2.1947   \n",
       "2019-01-18  000001.SZ  10.34  10.49  10.28  10.43      10.25    0.18   1.7561   \n",
       "2019-01-21  000001.SZ  10.34  10.47  10.32  10.34      10.43   -0.09  -0.8629   \n",
       "2019-01-22  000001.SZ  10.34  10.44  10.26  10.28      10.34   -0.06  -0.5803   \n",
       "2019-01-23  000001.SZ  10.29  10.47  10.29  10.35      10.28    0.07   0.6809   \n",
       "2019-01-24  000001.SZ  10.40  10.55  10.37  10.52      10.35    0.17   1.6425   \n",
       "2019-01-25  000001.SZ  10.56  11.04  10.55  11.00      10.52    0.48   4.5627   \n",
       "2019-01-28  000001.SZ  11.04  11.14  10.88  10.94      11.00   -0.06  -0.5455   \n",
       "2019-01-29  000001.SZ  10.96  11.07  10.77  11.00      10.94    0.06   0.5484   \n",
       "2019-01-30  000001.SZ  10.95  11.18  10.86  10.95      11.00   -0.05  -0.4545   \n",
       "2019-01-31  000001.SZ  10.98  11.20  10.94  11.10      10.95    0.15   1.3699   \n",
       "2019-02-01  000001.SZ  11.20  11.25  10.96  11.20      11.10    0.10   0.9009   \n",
       "2019-02-11  000001.SZ  11.08  11.21  10.97  11.21      11.20    0.01   0.0893   \n",
       "2019-02-12  000001.SZ  11.20  11.31  11.03  11.19      11.21   -0.02  -0.1784   \n",
       "2019-02-13  000001.SZ  11.19  11.41  11.12  11.38      11.19    0.19   1.6979   \n",
       "2019-02-14  000001.SZ  11.30  11.33  11.19  11.25      11.38   -0.13  -1.1424   \n",
       "2019-02-15  000001.SZ  11.23  11.23  10.90  10.95      11.25   -0.30  -2.6667   \n",
       "2019-02-18  000001.SZ  11.05  11.36  11.04  11.36      10.95    0.41   3.7443   \n",
       "2019-02-19  000001.SZ  11.36  11.62  11.24  11.27      11.36   -0.09  -0.7923   \n",
       "2019-02-20  000001.SZ  11.33  11.53  11.25  11.41      11.27    0.14   1.2422   \n",
       "2019-02-21  000001.SZ  11.38  11.55  11.28  11.36      11.41   -0.05  -0.4382   \n",
       "2019-02-22  000001.SZ  11.35  11.57  11.15  11.54      11.36    0.18   1.5845   \n",
       "2019-02-25  000001.SZ  11.70  12.64  11.57  12.55      11.54    1.01   8.7522   \n",
       "2019-02-26  000001.SZ  12.55  12.57  12.15  12.20      12.55   -0.35  -2.7888   \n",
       "2019-02-27  000001.SZ  12.24  12.66  12.15  12.40      12.20    0.20   1.6393   \n",
       "2019-02-28  000001.SZ  12.44  12.61  12.27  12.36      12.40   -0.04  -0.3226   \n",
       "2019-03-01  000001.SZ  12.48  12.78  12.20  12.76      12.36    0.40   3.2362   \n",
       "...               ...    ...    ...    ...    ...        ...     ...      ...   \n",
       "2020-04-08  000001.SZ  12.88  12.92  12.72  12.78      12.88   -0.10  -0.7764   \n",
       "2020-04-09  000001.SZ  12.88  12.89  12.72  12.74      12.78   -0.04  -0.3130   \n",
       "2020-04-10  000001.SZ  12.76  12.98  12.65  12.79      12.74    0.05   0.3925   \n",
       "2020-04-13  000001.SZ  12.67  12.71  12.47  12.59      12.79   -0.20  -1.5637   \n",
       "2020-04-14  000001.SZ  12.65  12.86  12.57  12.86      12.59    0.27   2.1446   \n",
       "2020-04-15  000001.SZ  12.86  12.93  12.78  12.87      12.86    0.01   0.0778   \n",
       "2020-04-16  000001.SZ  12.79  12.79  12.54  12.68      12.87   -0.19  -1.4763   \n",
       "2020-04-17  000001.SZ  12.77  13.04  12.65  12.89      12.68    0.21   1.6562   \n",
       "2020-04-20  000001.SZ  12.86  13.05  12.77  12.99      12.89    0.10   0.7758   \n",
       "2020-04-21  000001.SZ  13.30  13.70  13.30  13.45      12.99    0.46   3.5412   \n",
       "2020-04-22  000001.SZ  13.37  13.42  13.16  13.23      13.45   -0.22  -1.6357   \n",
       "2020-04-23  000001.SZ  13.23  13.31  13.11  13.23      13.23    0.00   0.0000   \n",
       "2020-04-24  000001.SZ  13.17  13.28  13.11  13.24      13.23    0.01   0.0756   \n",
       "2020-04-27  000001.SZ  13.30  13.64  13.25  13.50      13.24    0.26   1.9637   \n",
       "2020-04-28  000001.SZ  13.45  13.56  13.27  13.52      13.50    0.02   0.1481   \n",
       "2020-04-29  000001.SZ  13.48  14.10  13.45  14.02      13.52    0.50   3.6982   \n",
       "2020-04-30  000001.SZ  14.02  14.32  13.88  13.93      14.02   -0.09  -0.6419   \n",
       "2020-05-06  000001.SZ  13.76  13.89  13.61  13.77      13.93   -0.16  -1.1486   \n",
       "2020-05-07  000001.SZ  13.76  13.76  13.60  13.69      13.77   -0.08  -0.5810   \n",
       "2020-05-08  000001.SZ  13.76  14.02  13.68  13.95      13.69    0.26   1.8992   \n",
       "2020-05-11  000001.SZ  13.92  14.13  13.90  14.00      13.95    0.05   0.3584   \n",
       "2020-05-12  000001.SZ  13.95  14.05  13.72  13.79      14.00   -0.21  -1.5000   \n",
       "2020-05-13  000001.SZ  13.75  13.78  13.53  13.63      13.79   -0.16  -1.1603   \n",
       "2020-05-14  000001.SZ  13.55  13.59  13.22  13.30      13.63   -0.33  -2.4211   \n",
       "2020-05-15  000001.SZ  13.39  13.43  13.14  13.23      13.30   -0.07  -0.5263   \n",
       "2020-05-18  000001.SZ  13.20  13.34  13.12  13.20      13.23   -0.03  -0.2268   \n",
       "2020-05-19  000001.SZ  13.41  13.45  13.27  13.36      13.20    0.16   1.2121   \n",
       "2020-05-20  000001.SZ  13.38  13.62  13.27  13.51      13.36    0.15   1.1228   \n",
       "2020-05-21  000001.SZ  13.52  13.57  13.36  13.40      13.51   -0.11  -0.8142   \n",
       "2020-05-22  000001.SZ  13.33  13.34  12.92  12.92      13.40   -0.48  -3.5821   \n",
       "\n",
       "                   vol       amount        RSV          K          D  \\\n",
       "trade_date                                                             \n",
       "2019-01-14   500443.59   507862.882  87.272727  87.272727  87.272727   \n",
       "2019-01-15   542160.55   553027.309  96.460177  92.785197  90.580209   \n",
       "2019-01-16   977699.37  1017495.116  98.437500  95.462604  92.892922   \n",
       "2019-01-17   882811.92   910212.066  66.315789  83.355466  88.931210   \n",
       "2019-01-18   738793.26   769973.637  85.263158  84.087802  87.071892   \n",
       "2019-01-21   659355.76   684465.646  73.563218  80.241977  84.576149   \n",
       "2019-01-22   424413.57   438991.450  59.154930  72.775995  80.398241   \n",
       "2019-01-23   537876.63   559384.396  57.692308  67.543953  75.939505   \n",
       "2019-01-24   679240.88   711495.718  90.000000  75.229213  75.696418   \n",
       "2019-01-25  2108361.85  2299718.224  95.789474  82.203580  77.903750   \n",
       "2019-01-28  1035909.80  1141853.833  79.381443  81.251865  79.032842   \n",
       "2019-01-29   826631.10   904847.854  85.567010  82.701419  80.265199   \n",
       "2019-01-30   712001.01   785204.571  75.000000  80.121020  80.216891   \n",
       "2019-01-31   831622.75   922602.874  89.361702  83.211835  81.218637   \n",
       "2019-02-01  1014270.07  1127216.186  94.949495  87.133344  83.194719   \n",
       "2019-02-11   801936.63   889951.528  95.833333  90.037762  85.479211   \n",
       "2019-02-12   959936.90  1071873.084  87.234043  89.102239  86.688114   \n",
       "2019-02-13  1137365.74  1280182.096  96.511628  91.573708  88.317748   \n",
       "2019-02-14   869185.19   977818.097  75.000000  86.046645  87.560372   \n",
       "2019-02-15  1100127.46  1213914.428  28.125000  66.733622  80.616034   \n",
       "2019-02-18  1255522.21  1408279.680  90.909091  74.793728  78.674876   \n",
       "2019-02-19  1270882.04  1445281.382  51.388889  66.991072  74.779754   \n",
       "2019-02-20   832629.87   949430.819  70.833333  68.271940  72.610289   \n",
       "2019-02-21   754246.48   860591.070  63.888889  66.810836  70.677023   \n",
       "2019-02-22  1184047.79  1343020.336  88.888889  74.170478  71.841555   \n",
       "2019-02-25  2824935.02  3415946.860  94.827586  81.056363  74.913238   \n",
       "2019-02-26  2017544.93  2485673.356  74.712644  78.941753  76.256100   \n",
       "2019-02-27  1979013.88  2454404.411  85.227273  81.036951  77.849736   \n",
       "2019-02-28  1113099.80  1383110.810  81.481481  81.185129  78.961542   \n",
       "2019-03-01  1712679.16  2137669.556  98.773006  87.047785  81.656970   \n",
       "...                ...          ...        ...        ...        ...   \n",
       "2020-04-08   528716.14   676604.872  27.710843  40.903345  46.958157   \n",
       "2020-04-09   408553.77   522027.888  22.891566  34.899419  42.938578   \n",
       "2020-04-10   666674.95   853689.950  41.379310  37.059383  40.978846   \n",
       "2020-04-13   446214.40   562008.050  18.181818  30.766861  37.574851   \n",
       "2020-04-14   686086.87   874856.562  59.090909  40.208211  38.452638   \n",
       "2020-04-15   656396.40   843649.273  78.431373  52.949265  43.284847   \n",
       "2020-04-16   789154.98   997623.816  41.176471  49.025000  45.198231   \n",
       "2020-04-17  1331164.77  1713215.766  73.684211  57.244737  49.213733   \n",
       "2020-04-20   818455.83  1058524.019  89.655172  68.048215  55.491894   \n",
       "2020-04-21  2122448.34  2861879.086  79.674797  71.923742  60.969177   \n",
       "2020-04-22  1032802.74  1368222.854  61.788618  68.545368  63.494574   \n",
       "2020-04-23   646989.63   855052.110  61.788618  66.293118  64.427422   \n",
       "2020-04-24   566001.61   747473.770  60.344828  64.310354  64.388399   \n",
       "2020-04-27   936829.90  1263809.737  82.758621  70.459776  66.412192   \n",
       "2020-04-28   771564.17  1038718.080  84.482759  75.134104  69.319496   \n",
       "2020-04-29  1108722.39  1541638.203  94.482759  81.583655  73.407549   \n",
       "2020-04-30   819540.43  1155968.238  74.838710  79.335340  75.383479   \n",
       "2020-05-06  1008998.02  1382727.481  54.545455  71.072045  73.946335   \n",
       "2020-05-07   662749.23   904349.531  47.933884  63.359325  70.417331   \n",
       "2020-05-08   934781.70  1297924.588  69.421488  65.380046  68.738236   \n",
       "2020-05-11   612862.29   859156.594  73.553719  68.104603  68.527025   \n",
       "2020-05-12   558511.14   772109.502  50.467290  62.225499  66.426516   \n",
       "2020-05-13   640358.79   871062.043  34.285714  52.912237  61.921757   \n",
       "2020-05-14   944672.09  1259440.848   7.272727  37.699067  53.847527   \n",
       "2020-05-15   756794.47  1004313.267   7.627119  27.675084  45.123379   \n",
       "2020-05-18   637208.57   843479.669   7.920792  21.090320  37.112360   \n",
       "2020-05-19   600368.64   801755.671  23.762376  21.981006  32.068575   \n",
       "2020-05-20   690851.07   929928.885  38.613861  27.525291  30.554147   \n",
       "2020-05-21   552312.00   742797.057  27.722772  27.591118  29.566471   \n",
       "2020-05-22   856237.33  1119433.491   0.000000  18.394079  25.842340   \n",
       "\n",
       "                     J KDJ金叉死叉  \n",
       "trade_date                      \n",
       "2019-01-14   87.272727          \n",
       "2019-01-15   97.195173      金叉  \n",
       "2019-01-16  100.601966          \n",
       "2019-01-17   72.203977      死叉  \n",
       "2019-01-18   78.119623          \n",
       "2019-01-21   71.573634          \n",
       "2019-01-22   57.531502          \n",
       "2019-01-23   50.752848          \n",
       "2019-01-24   74.294804          \n",
       "2019-01-25   90.803238      金叉  \n",
       "2019-01-28   85.689910          \n",
       "2019-01-29   87.573858          \n",
       "2019-01-30   79.929279      死叉  \n",
       "2019-01-31   87.198231      金叉  \n",
       "2019-02-01   95.010594          \n",
       "2019-02-11   99.154864          \n",
       "2019-02-12   93.930490          \n",
       "2019-02-13   98.085627          \n",
       "2019-02-14   83.019192      死叉  \n",
       "2019-02-15   38.968799          \n",
       "2019-02-18   67.031431          \n",
       "2019-02-19   51.413708          \n",
       "2019-02-20   59.595241          \n",
       "2019-02-21   59.078461          \n",
       "2019-02-22   78.828326      金叉  \n",
       "2019-02-25   93.342612          \n",
       "2019-02-26   84.313058          \n",
       "2019-02-27   87.411380          \n",
       "2019-02-28   85.632302          \n",
       "2019-03-01   97.829414          \n",
       "...                ...     ...  \n",
       "2020-04-08   28.793722          \n",
       "2020-04-09   18.821102          \n",
       "2020-04-10   29.220456          \n",
       "2020-04-13   17.150882          \n",
       "2020-04-14   43.719356      金叉  \n",
       "2020-04-15   72.278100          \n",
       "2020-04-16   56.678538          \n",
       "2020-04-17   73.306744          \n",
       "2020-04-20   93.160859          \n",
       "2020-04-21   93.832874          \n",
       "2020-04-22   78.646956          \n",
       "2020-04-23   70.024510          \n",
       "2020-04-24   64.154265      死叉  \n",
       "2020-04-27   78.554946      金叉  \n",
       "2020-04-28   86.763320          \n",
       "2020-04-29   97.935868          \n",
       "2020-04-30   87.239062          \n",
       "2020-05-06   65.323466      死叉  \n",
       "2020-05-07   49.243312          \n",
       "2020-05-08   58.663665          \n",
       "2020-05-11   67.259760          \n",
       "2020-05-12   53.823464          \n",
       "2020-05-13   34.893199          \n",
       "2020-05-14    5.402148          \n",
       "2020-05-15   -7.221506          \n",
       "2020-05-18  -10.953759          \n",
       "2020-05-19    1.805867          \n",
       "2020-05-20   21.467579          \n",
       "2020-05-21   23.640413          \n",
       "2020-05-22    3.497556          \n",
       "\n",
       "[328 rows x 15 columns]"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_whole"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_whole.to_csv(\"C:/Users/yons/Desktop/stock_database/00001.csv\",encoding = 'gbk')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
